How do I get the names of files in a folder from a dropbox folder?

Hi Everyone,

I would appreciate if anybody is able to help me out,

Goal:

Im currently trying to have Dropbox list all of the file names for multiple images in a folder. For this I am using the Dropbox module “List All Files/Subfolders In a Folder” module.

I then want the names of the image files to be given to ChatGPT. ChatGPT will then select one of the files from the list at random.

I will then have the randomly selected image searched for and uploded to wordpress.

The system allows blog articles to have a different image from a selection of previously approved images.

The Problem

Currently the Dropbox folder outputs the files within the folders as bundles (please see below)

I have tried to use an iterator to seperate the bundles (please see below)

Output of iterator:

However the result of the iterator doesnt work with chatGPT.

I just need a way of having dropbox list all of the image file names within the folder so I can give these to ChatGPT.

Thanks!


Here are the output bundles for dropbox:

[
{
“.tag”: “file”,
“name”: “jeremy-bishop-tqG48KOMKfY-unsplash.jpg”,
“path_lower”: “/autoblogger images/jeremy-bishop-tqg48komkfy-unsplash.jpg”,
“path_display”: “/Autoblogger Images/jeremy-bishop-tqG48KOMKfY-unsplash.jpg”,
“id”: “id:nklIf4sooWEAAAAAAAAABQ”,
“client_modified”: “2024-07-03T07:15:43.000Z”,
“server_modified”: “2024-07-03T07:16:53.000Z”,
“rev”: “61c529d643529c39e0a03”,
“size”: 1887101,
“is_downloadable”: true,
“content_hash”: “db9236a0e742fb6b0001484dcf8c2b7b1c0fdb25b8a116fb963cd26dedc8a13b”,
IMTLENGTH”: 3,
IMTINDEX”: 1
},
{
“.tag”: “file”,
“name”: “bailey-mahon-Hau6K6VP5vs-unsplash.jpg”,
“path_lower”: “/autoblogger images/bailey-mahon-hau6k6vp5vs-unsplash.jpg”,
“path_display”: “/Autoblogger Images/bailey-mahon-Hau6K6VP5vs-unsplash.jpg”,
“id”: “id:nklIf4sooWEAAAAAAAAABw”,
“client_modified”: “2024-07-03T07:17:56.000Z”,
“server_modified”: “2024-07-03T07:17:56.000Z”,
“rev”: “61c52a11e766fc39e0a03”,
“size”: 3452877,
“is_downloadable”: true,
“content_hash”: “f758d905e1cf47c67eacb2dd965a23a6f49e96a867d359552046c5f71e0ce7ea”,
IMTLENGTH”: 3,
IMTINDEX”: 2
},
{
“.tag”: “file”,
“name”: “tim-marshall-9tta3btd8hE-unsplash.jpg”,
“path_lower”: “/autoblogger images/tim-marshall-9tta3btd8he-unsplash.jpg”,
“path_display”: “/Autoblogger Images/tim-marshall-9tta3btd8hE-unsplash.jpg”,
“id”: “id:nklIf4sooWEAAAAAAAAACA”,
“client_modified”: “2024-07-03T07:18:05.000Z”,
“server_modified”: “2024-07-03T07:18:06.000Z”,
“rev”: “61c52a1b72ff2c39e0a03”,
“size”: 2859672,
“is_downloadable”: true,
“content_hash”: “de62549efd6c3d4fe75ebc10a3de34218766567ed6cabcae3891a36d83ecc138”,
IMTLENGTH”: 3,
IMTINDEX”: 3
}
]

Here are the output bundles for the iterator:

[
{
“value”: 3,
IMTINDEX”: 1,
IMTLENGTH”: 1
}
]

Nooo, the Iterator module is only if you are dealing with an ARRAY.

The results are already in different bundles.

Every result (item/record) from a search/match module will output a bundle. To “combine” them into a single structure (like an ARRAY), you’ll need to use an aggregator of some sort.

Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and has applies to many use-cases.

There are other types of aggregator modules, click the below links to find out more:

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 —

General

Help Center Basics

Articles & Videos

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

1 Like

Hi @Jamie_Harris
You have to map {{Name}} to get file name. Please note that you have to pass an array in the iterator.

Regards,
Msquare Automation - Gold Partner of Make

Free Consultation | Live Implementation

Visit us here | Youtube Channel

Hi Msquare,

Thanks for the reply,

After I map the name it looks like this has split the bundle into 3 outputs. However im still struggling to get the correct value in the ChatGPT module. Do you know I can feed the names of the files as a list to ChatGPT?

Iterator output:

ChatGPT Options

Like I mentioned, you don’t need an Iterator module. Delete it. It is confusing to use an Iterator module with something else other than an ARRAY.

Use an Array Aggregator module to combine the results first.

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

1 Like

Hi Sam,

Thanks for the reply,

Okay so ive used an array aggregator. So this has combined the 3 bundles into 1 result? Can the result be fed straight into ChatGPT or will i need to use something else to split the new bundle into individual results?

Thanks for the help!

Hi @Jamie_Harris
You have to pass the record id alone here:

From the blueprint you provided, we could see the mapping was wrong. If you still face same issues let us know.

Regards,
Msquare Automation - Gold Partner of Make

Free Consultation | Live Implementation

Visit us here | Youtube Channel

1 Like

After some playing around I used a “Text Aggregator” that collected the “Name” value from the dropbox bundles. It was orginally giving the names in one paragraph all together with no seperation.

The text aggregator however has an option of “New row”

image

This allows me then to pass the result to ChatGPT.

Thanks for the help @samliew & @Msquare_Automation

2 Likes