Re: Uploading, matching, and attaching files - is this possible?

1618 2
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

I have a table that has a text column containing filenames. Each record has a single filename in it.

On my computer, stored locally, I have a folder that is full of the actual files referenced by the filename field.

What I want to do is create a script that goes through each record, attempts to match the filename to one of the files in the local folder, and then if there is a match uploads the matching file as an attachment to the record.

Does this sound possible? Or am I dreaming impossible scripting-block dreams?

5 Replies 5

Currently, the scripting block does not have access to the local file system.

However, the scripting block can access resources on the internet. If you place the files on the web, you can upload them to an attachment field. See the scripting API reference for the write format.

This was also announced recently:

Maybe it would help?

While input.fileAsync does let users upload files, I don’t see a way to upload a local file without user intervention for each file.

Yes, this is the crux. I might have to follow your advice and upload them independently onto the web somewhere, and then upload them as attachments. Thanks for your input and valuable thoughts!

5 - Automation Enthusiast
5 - Automation Enthusiast

I am doing something similar but was planning to first use the gallery view bulk upload (purple X) that gives the option to create a record for each image rather than hosing elsewhere. The gallery attachment upload uses the filename as the primary field. My quandary is how to do what @hgld is asking I think - how then to match to a field name in a separate table, link and attach these images to their corresponding field name. Here are screenshots from a screencast showing how I am doing it manually with linked record. But I have 5,000 sketches I have to match up. Screen Shot 2020-06-13 at 10.31.30 AM Screen Shot 2020-06-13 at 10.31.50 AM Screen Shot 2020-06-13 at 10.32.02 AM Screen Shot 2020-06-13 at 10.32.11 AM