How to get for every column with [attachment] to check with the files in a folder and move that file to the person name folder?


I have an excel file that is using write range from JSON array and then read range.
The header of the excel can be more of attachment column and text column.

I need to check for every header that has the word [attachment] to check against a list of files in one folder.
For every row, I have created a folder of the person name by combining first name and last name.

Currently, I hardcoded to read every row of Image Attachment and Video Attachment. But what if there is a multiple header column of Attachment? How can I check the files in that columns and the files in the folder and then if its match, move the file from one folder to the folder of the person name.
HardcodedAttachment

Thanks.

To find the right columns, you can use something like this:

1 Like