Sort PNG Files based on last 4 digits in chronological, ascending order and extract data into Google Sheets

Hey guys,

I am trying to automate a process which extracts data from a PNG pictures (e.g. date, IG Name etc.) and insert the data into a Google Sheets document (for each picture a designated row). Of crucial importance in this process is the right sequence in chronological, ascending order of the pictures taken from Google Drive (i.e., IMG_3252, IMG_3253, IMG_3254 etc.) to be inserted into the Google sheets.

However, when conducting the task Make is mixing up the sequence (e.g. 1. IMG_3252, 2. IMG_3254, 3. IMG_3253) and I cannot find a solution how to automatically sort the pictures in the right sequence and afterwards insert it into a Google Sheets document. I´ve tried solutions from comparable problems using parsenumber functions and others in the community but doesn´t seem to work…

The sequence should be based on the last 4 digits of the File name and in ascending order.

Can you help me how to sort out the right sequence, bundle the data once again and then transform it into actual rows in Google Sheets?

Thanks so much in advance!


In addition, I am searching for a non paid solution, i.e. no JavaScript Codes etc.

Welcome to the Make community!

Error 1: Your array aggregator source module should be the Search module, not the download module.

Error 2: The third parameter of the sort function must be manually typed in, not selected from the variables panel.

samliew – request private consultation

Join the unofficial Make Discord server to chat with us!

1 Like

Awesome @samliew that worked, thanks a lot! Following through with my solution, now I run an error when it comes to using my ChatGPT module.

Beforehand, I could select the option “Google Drive - Download a file”, which is now replaced by a “Map” only option.

Can you help me how to proceed once I have the right sequence of the PNG files and how to extract my data now?

Before:


After:

You probably need a second pair of Iterator-Aggregator so that you can map an array of images into the images field.

Every result (item/record) from a search/match module will output a bundle. To “combine” them into a single structure, 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.

Read this

The Array Aggregator module also allows you to build a complex array of collections for a later module’s field to map multiple items (collections) to it.

Here is an example of using the “Target structure type” of an Array Aggregator module:

As you can see, the “Map” toggle on fields are used when you have an array. You can easily build an array variable to map to a field, by using an Array Aggregator module and select the “Target Structure Type” as the future field you want to map the array into.

samliew – request private consultation

Join the unofficial Make Discord server to chat with us!

1 Like