Hello
I am posting a wordpress article by watching gdoc file in a folder. In order to add a featured image I would like to choose a random image from another folder on Google Drive (containing a selection of images).
Using Google Drive Download a file I will need to provide a file ID. But basically I just would like to take any picture, as long as it hasn’t been used before.
Thanks for any hint!
This is easy, just aggregate all the images into a single array, and use the get
built-in function to get a random item with the random
variable.
For more information on how to use the random
variable, see https://www.make.com/en/help/functions/math-variables#random
Now this is the more difficult part. To avoid using an already used item, you need to know if the item has been used before. How are you going to track that?
You could use a Data Store to store previously-used IDs, but that requires you to use both Search and Update modules, resulting in two additional operations per run.
3 Likes
HI Sam
I just figured I move the used images into another folder… so they can’t be reused.
1 Like
@floripaolo
That’s a good idea, meaning you have added the ‘Move a file/folder’ module:
I hope that is working for you.
3 Likes