Aug 12, 2024 04:26 PM
Hello,
I am working on integrating my google calendar with my airtable base so that I can include all of the meetings that I have with members of my contact list on their contact profile as a linked record to the calendar table. I created an automation to do this for me (see below).
The issue that I have found is that when more than 1 of the contacts that are added to the calendar invite for the meeting is found within my big "Contacts" table, it will grab the unique IDs for both of the contacts and it goes to add my calculated field (the first one in the image below, my primary field, and the only field that I want to add), to my synced calendar "Contacts" field within my calendar table.
The problem is the automation tries to update the linked contacts (eg. "Arjin Claire, Evolution") in this "Contacts" tab, but it throws an error when more than 1 are being added. I believe it reads each of these contacts as being concatenated together and since the value is calculated via a formula it throws an error because it wants to create a new cell with each of the contacts that it's taken in. I tried fixing this by making the formula a singl-text line but it doesn't show up how I want it to. I believe the issue lies within the formatting of the field portion within my automation:
I've tried using commas, semicolons, etc. to separate each of these values, but I can't find a way that works as of yet. I also tried making a separate automation for each of the 5 records that I am finding, but a new error occurs where each one is replaced by the other in an infinite loop, so I don't think that's a viable solution.
Any help is much appreciated 🙂
Aug 12, 2024 08:00 PM
Hiya and welcome!
Here are some of the fixes I can see:
Depending on your use case, there is often a simpler way to do this. I'm happy to explore optimizing with you if you want to share more on how the data is set
Aug 13, 2024 02:31 AM
I've thrown something together here for you to check out. It uses a script to combine the multiple "Find Record" results into a single array:
let {array1, array2} = input.config()
let consolidated = [].concat(array1, array2);
output.set('array', consolidated)
And uses it in the 'Update Record' action:
This is an alternative method to what @Sistema_Aotearo mentions in point 2 of their post; I favour this method as working with a lot of conditions in automations is really laggy for me and kind of frustrating to deal with
Aug 13, 2024 02:14 PM
Hi @Sistema_Aotearo,
Thank you for the solution! I think the conditional logic that I would need for this would make it really bulky so I'll probably go with the other solution, but thanks to you I know finally understand the problem properly!
Thanks,
Arjin
Aug 13, 2024 02:15 PM
Thank you so much! This works super well. I had a feeling that the Script Editor is what I would need to use but I hadn't gotten used to writing using the code that Airtable has in place, so I was getting lost trying to implement it. So far the solution you provided works perfectly and fingers crossed it stays that way 🙂
Huge thanks again for helping me out!
Arjin
Aug 13, 2024 03:29 PM
That's so helpful I've never tried that! I'll probably start using this script in my automations too!