Script/Settings/Formula to Force New Rows in Table?
Hello!
When uploading images/attachments, the images are being put all into the same “Attachment” cell. I am trying to find a method that forces each image to get its own row in the table instead of being grouped together in a single cell.
Can anyone help me out with this?
Thanks,
Doug.
Page 1 / 1
How are you uploading your attachments?
One quick way of doing this is to just drag-and-drop all of your attachments onto the grid view, but before letting go of your mouse button, you’ll need to drag the attachments down to the bottom of the screen where it says “Drag Here To Create New Records”.
Note that this can only be done from the “Data” layer… I don’t believe that this can be done from the Interfaces layer.
Another way of doing this would be to create a form that lets users drag-and-drop all of their attachments into the attachment field.
Then you can create an automation that loops through the attachment field and create a new record for each attachment.
Note that you will probably want to do this in 2 separate tables. One table is where you will build your form to collect your new form entries, and then the other table would be where you would create the new records.
p.s. I should also probably mention that Fillout’s advanced forms for Airtable will give you even more control over your attachments, such as limiting the file size. You can read more about this in this support article: File Uploads.
I was using this form as a page to upload images to.
And this is how it was appearing in the table the form is mapped to.
So it seems like the automation method you mentioned would be the best way to do this currently? Uploads are going to be from pilots in the field, most likely on a phone or laptop.
Yes, that’s correct.
You would want to create an automation that is triggered when a form is submitted.
Then, create a repeating group that loops through the attachment field, as the “input list”, and that will enable you to create a new record for each attachment.
Great question — this is a common situation when working with file uploads in Airtable. By default, when multiple attachments are uploaded at once (e.g., via a form or manual upload), they get grouped into a single “Attachment” cell. To ensure each image is saved in its own row, you’ll need to use a small workaround involving Airtable Automation and a script (or an integration tool like Make if you're using Softr).
Here’s a simple approach using Airtable Scripting:
Create a form or table where users upload multiple images into one “Attachment” field.
Set up a new table called “Uploaded Images” with fields:
Image (Attachment)
Parent Record (Link to original table)
Use an Automation with a Script action to split the attachments:
Trigger: When a new record is created or when “Attachment” is updated.
Action: Run script to loop through each image in the cell and create a new row per image.
Here’s a sample script snippet:
javascript
CopyEdit
let table = base.getTable("Your Original Table"); let imageTable = base.getTable("Uploaded Images"); let recordId = input.config().recordId; let record = await table.selectRecordAsync(recordId); let attachments = record.getCellValue("Attachment"); for (let file of attachments) { await imageTable.createRecordAsync({ "Image": tfile], "Parent Record": [{id: record.id}] }); }
This setup ensures each attachment gets its own row, and you can trace them back to the original upload.
Let me know if you’d like help tailoring this to your specific setup — happy to assist further!