Need help in copying images from one table to another (using script)

Hello!

My goal would be to automatically add photos from Table 2 (where they are imported in bulk) to Table 1 (with the right item order).
The only link between the items in the two tables is a code/name column.
I tried my best experimenting with formulas in Airtable and GSheet, but I couldn’t find any solution. I copied a script from an older community topic: Programmatically copy images from one table to another , but it doesn’t seem to work.

Can someone please help figure out what the problem might be, or offer another solution? Here’s a simple version of my base (Restaurant):
https://airtable.com/invite/l?inviteId=invyOwrzT6i00qbss&inviteToken=1c708dfb92651fb230f375f758d4d172ad56602b0347fccf8ac86f495d5a8522 , where the pasta dishes (Menu Item Name) should get the photos in the Attachments column from the Image column in Table 2, connected by the Name and Code columns.

Thank you!

Hi Agota, and welcome to the community!

This is a touchy aspect of the Airtable platform. The following thread (and example code) might help.

Welcome to the Airtable community!

Is there a particular reason why you want to copy the photos with a script?

Since the tables are in the same table, you could move the “code” in [Table 1] to a different field (not the primary field) and convert it to a linked record field. Then pull the image across using a lookup field.

FYI, the shared link in your post adds anyone who clicks on it as a creator in your workspace. It looks like the workspace has only one table and is on a pro trial, so you shouldn’t be charged (yet) when someone clicks on the link. However, you might want to edit your post to change the link to a read-only shared link to just the base. That way you won’t be charged and people won’t have creator access to other bases that you might create.

Thank you!

A script would probably be the best solution, because I would like to use it on tables with hundreds of items, where it would take a long time to drag and drop the photos into the right row.

Basically, I have a long list of items and a big batch of photos, and I would like to link them together without hours of repetitive manual work.

I totally understand not wanting hours of repetitive work. However, converting a field to a linked record field and using lookups could be done in a couple of minutes with the base design you shared, even with hundreds of records. You can create a new linked record field and copy/paste the codes in one giant column copy/paste. Airtable will convert the text strings to links when you paste into the linked record field.

1 Like

When I was trying to find a solution with links and formulas, I somehow missed this. Thank you very much kuovonne!

This topic was solved and automatically closed 3 days after the last reply. New replies are no longer allowed.