Hello community!
My goal:
- Count the amount of files in a Monday.com file column immediately after upload and write that number to a number column
- Extract the name of the uploading person and write it to a separate text column
- rename the file(s) in the upload column using info from other columns plus an incrementing number in case of more than one file (in order to have individual file names.
The file column is in a subitem of a ‘normal’ item.
Steps tried so far:
Goal 1 and 2 I achieved using a webhook trigger (upon change, i.e. upload in file column), ‘Get a user’, ‘Get an item’, ‘Numeric aggregator’ and ‘Update Column values of a Specific item’ modules (see screenshot below).
Goal 3 I approached by adding a Router to the scenario, in order to account for the case of multiple files. The Router splits up the way to goal 1 and 2 vs. goal 3.
Since I did not have an idea how to actually rename existing files, I did a workaround, downloading the file and writing it to another file column, while renaming it at the same time.
The Iterator uses as input the Array of the file column of the ‘Get an item’ module.
The ‘Download a file’ module uses the Asset ID from the Iterator as input.
The aggregator is supposed to bundle the whole thing in order to have the last module update the second file column only once…
This screenshot illustrates an example where two files have been uploaded.
My problem now is that the scenario runs as many times as there are files, despite the aggregator that I put in place. This means I get 4 files in case of 2 uploaded ones, 9 in case of 3 and so on…
Also, I do not know as yet how to add an incrementing number to the file name, to achieve the goal of individual file names.
These are the aggregator settings:
And these settings of the final module (‘Add a File to a file column Value’):
Any help with this would be much appreciated!
Cheers!
Update:
adding blueprint of scenario
blueprint_Monday_file_processor.json (37.2 KB)