# How to Search 5 Random Files from Google Drive and Get Shareable Links in Make.com?

**URL:** <https://community.make.com/t/how-to-search-5-random-files-from-google-drive-and-get-shareable-links-in-make-com/71286>\
**Category:** Questions\
**Tags:** google-drive\
**Created:** [February 24, 2025, 2:09pm UTC](https://community.make.com/t/how-to-search-5-random-files-from-google-drive-and-get-shareable-links-in-make-com/71286 "2025-02-24T14:09:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Heyitsjan2025](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/heyitsjan2025/32/64475_2.png) [@Heyitsjan2025](https://community.make.com/u/Heyitsjan2025)\
**Post date:** [February 24, 2025, 2:09pm UTC](https://community.make.com/t/how-to-search-5-random-files-from-google-drive-and-get-shareable-links-in-make-com/71286/1 "2025-02-24T14:09:31Z")

</div>

### **How to Search 5 Random Files from Google Drive and Get Shareable Links in [Make.com](http://Make.com)?**

Hi everyone,

I have a **Google Drive folder** with more than **2500 files** , all named sequentially from **LeaMarie1.png** to **LeaMarie2500.png**. I want to create an automation in **[Make.com](http://Make.com)** that:

1. **Selects 5 random files** from this folder.
2. **Retrieves their file IDs**.
3. **Generates shareable links** for them.

I tried using the following query to generate a random filename:

make

CopyEdit

```auto
{{add(emptyarray; "LeaMarie"; floor(random * 2500) + 1 ;"LeaMarie"; )}}

```

However, this only returns **one** image at a time, but I need **five** in a single execution.

What’s the best way to generate 5 random file names at once and use them in the automation? Any help or alternative approach would be greatly appreciated!

Thanks in advance! 😊

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [February 24, 2025, 3:50pm UTC](https://community.make.com/t/how-to-search-5-random-files-from-google-drive-and-get-shareable-links-in-make-com/71286/3 "2025-02-24T15:50:01Z")

</div>

Welcome to the Make community!

Yes, that is possible. You’ll need a minimum of four modules:

 ![Screenshot_2025-02-24_230223](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/c/3/c30e145a87cb4a6ab22ba54da9d34d57dc362eb4.png)

 ![Screenshot_2025-02-24_230242](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/9/f/9f3bbd9abcdb70deb57c294f460f6f83502694a8.png)

This is just an example. Your final solution may or may not look like this depending on your requirements.

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

— @samliew

P.S.: Investing some effort into the [Make Academy](https://academy.make.com) will save you lots of time and frustration using Make.

## Module Export - quick import into your scenario

You can **copy** and **paste** this module export into your scenario. This will import the modules (with fields/settings/filters) shown in my screenshots above.

1. Move your mouse over the line of code below. Copy the JSON by clicking the copy button on the **right** of the code, which looks like this:  
 ![](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/c/8/c84e1e230dccfa07b6d6d27e2c0fecf7dc7a5c32.png)

2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the editor.

3. Click on each imported module and re-save it for validation. There may be some errors prompting you to remap some variables and connections.

**JSON module export** — paste this directly in your scenario

```json
{"subflows":[{"flow":[{"id":276,"module":"google-drive:searchForFilesFolders","version":4,"parameters":{" __IMTCONN__":94797},"mapper":{"select":"list","retrieve":"file","limit":"99999","destination":"drive","folderId":"/"},"metadata":{"designer":{"x":410,"y":-2049},"parameters":[{"name":" __IMTCONN__","type":"account:google-restricted","label":"Connection","required":true}]}},{"id":277,"module":"builtin:BasicAggregator","version":1,"parameters":{"feeder":276},"filter":{"name":"permission","conditions":[[{"a":"{{276.ownedByMe}}","o":"boolean:equal","b":"{{true}}"},{"a":"{{276.owners[].me}}","o":"boolean:equal","b":"{{true}}"},{"a":"{{276.mimeType}}","o":"text:notcontain:ci","b":"folder"}]]},"mapper":{"id":"{{276.id}}"},"metadata":{"designer":{"x":701,"y":-2049}}},{"id":278,"module":"builtin:BasicFeeder","version":1,"parameters":{},"mapper":{"array":"{{slice(shuffle(map(277.array; \"id\")); 0; 5)}}"},"metadata":{"designer":{"x":942,"y":-2051}}},{"id":279,"module":"google-drive:shareAFileFolder","version":4,"parameters":{" __IMTCONN__":94797},"mapper":{"destination":"drive","select":"file","role":"reader","type":"anyone","file":"{{278.value}}","allowFileDiscovery":false},"metadata":{"designer":{"x":1187,"y":-2054},"parameters":[{"name":" __IMTCONN__","type":"account:google-restricted","label":"Connection","required":true}]}}]}],"metadata":{"version":1}}

```

_Note: Did you know you can reduce the size of blueprints and module export code like the above, using the [Make Blueprint Scrubber](https://community.make.com/t/free-tool-reduce-blueprint-module-export-by-removing-extra-details/50697)?_

---

<div class="post-metadata">

**Author:** ![Heyitsjan2025](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/heyitsjan2025/32/64475_2.png) [@Heyitsjan2025](https://community.make.com/u/Heyitsjan2025)\
**Post date:** [February 24, 2025, 7:41pm UTC](https://community.make.com/t/how-to-search-5-random-files-from-google-drive-and-get-shareable-links-in-make-com/71286/4 "2025-02-24T19:41:37Z")

</div>

Its working , Thank you so much 🙏🏻

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [February 24, 2025, 10:10pm UTC](https://community.make.com/t/how-to-search-5-random-files-from-google-drive-and-get-shareable-links-in-make-com/71286/5 "2025-02-24T22:10:26Z")

</div>

No problem, glad I could help!

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](https://community.make.com/t/make-community-the-ultimate-topic/11682) 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](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/5/d/5d9b26fbef0fd7385a34084f61cd5b9165786f42.png)

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

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

— @samliew

P.S.: Investing some effort into the [Make Academy](https://academy.make.com) will save you lots of time and frustration using Make.

---

<div class="post-metadata">

**Author:** ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)\
**Post date:** [March 11, 2025, 6:46am UTC](https://community.make.com/t/how-to-search-5-random-files-from-google-drive-and-get-shareable-links-in-make-com/71286/6 "2025-03-11T06:46:48Z")

</div>


