How to Select a Random Image from Google Drive and Linking It to Data in Google Sheets

Hello,
I have a folder in Google Drive that contains images (currently 15 images), and each image’s name carries a specific code.
I also have a Google Sheet with 500 rows of certain data, including a column for the codes.
I want to create a scenario where each day, a random image is selected from the Drive folder, then the corresponding row in the sheet is found using the image’s name (code), and a certain scenario is completed and posted on social media.
Can you help with this?
Thank you.

Welcome to the Make community!

You can list/search all files in the folder. This will output one bundle per file.

Screenshot_2024-08-26_130848

Then,

When you have multiple bundles and want just one item, you can use an Array Aggregator first to combine them into an array, then use the shuffle-first functions.

If you already have an array, then just use the shuffle-first functions directly. You can put this in a Set Variable module if you need a module to put these functions in.

{{ first(shuffle(array)) }}

Hope this helps! Let me know if there are any further questions or issues.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

3 Likes

Thank you, your advice finally worked after hours of searching and experimenting earlier. :smiley:

I have some questions, please:

  1. In the same scenario, I have two paths (Router) after a certain point. How can I execute all paths regardless of any errors that occur in the first path, for example?

  2. How can I restart the scenario from the beginning (or retry execution starting from a specific module) if an error occurs in one of the modules?

  3. In the (Watch Comments) module, how can I fetch any new comment without entering the post ID? I want to create a scenario to reply to comments on all posts.

No problem, glad I could help!

Please, one question per thread, and also provide more information about your scenario in each please.

1. If anyone has a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

  • others can save time when catching up with the latest activity here, and
  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

4. Learn more about how to use Make.

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

Getting Started

Help Centre Basics

Articles & Videos

Hope this helps! Let me know if there are any further questions or issues.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!