Jul 22, 2024 09:57 PM
Hello Community,
I need help with one task that should help us save lots of time. We have two tables with attachment field in both tables. One table is called Appointments where we upload an invoice in the attachment field called "Invoice" and another table is called "Contacts" where we store all invoices in the field "All Invoices" for a certain contact. What we are trying to do: When an invoice added to attachment field in "Appointments", we want a copy of this invoice to automatically go to a dedicated attachment field in "Contacts".
When I try Gemini AI help, the answer was like this: Airtable doesn't currently offer a built-in way to automatically copy attachments between fields when one is updated. However, you can achieve this using a combination of scripting and automations. Here's a general approach:
1. Create a script that loops through the updated record's attachments and copies them to the desired field.
2. Set up an automation triggered "when a record is updated."
3. Within the automation, use a "Run a script" action to execute the script you created in step 1.
This way, whenever a record is updated and the attachment field is modified, the script will automatically copy the attachments to the other field.
My question is this, is it possible to execute when fields are located in 2 different table and if yes, can someone help us to create a script for this automation? Thank you in advance for your help
Solved! Go to Solution.
Jul 23, 2024 02:32 AM
Hmm, you don't need a script for this and can just do it with automations:
If the contact has no existing invoices, we just update it with the attachment from "Appointments":
If they do have existing invoices, we append:
Jul 23, 2024 07:15 PM
Yeap, sure! Here are some screenshots:
If you're still facing issues just DM me an invite link to your base and I can sort it for you real quick
Jul 23, 2024 02:32 AM
Hmm, you don't need a script for this and can just do it with automations:
If the contact has no existing invoices, we just update it with the attachment from "Appointments":
If they do have existing invoices, we append:
Jul 23, 2024 04:52 PM
Hello and thank You for Your help, I managed to recreate all the steps that You showed, except for the last one, Otherwise Update Record in the section fields. See the screenshot please. So, my Attachments field is called "DC" and I inserted it into the "Fields". I was not able to recreate you last one which says "List of All Invoices'List of ExpiringD...", can you please specify the path how to select this option.
I tried the automation, it works (thanks to You), but what happened is: if the field "All Invoices" is empty, it copies the invoice without any problem, but if there is already an old invoice, it replaces it with the new one. But I need to keep both. Thanks again for your help
Jul 23, 2024 07:15 PM
Yeap, sure! Here are some screenshots:
If you're still facing issues just DM me an invite link to your base and I can sort it for you real quick