Help

Re: Feeding multiple linked records via Integromat

6637 0
cancel
Showing results for 
Search instead for 
Did you mean: 
ssmith
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi everyone,

I’m new to arrays and I think I’m missing something very obvious here but I thought I’d ask and see if someone could point it out to me.

I have a base which has two relevant tables, Customer and Other Party. Each Customer could be related to one or more other parties and vice versa each Other Party could be related to one or more Customers. Each table uses the email address as the primary key.

I’m trying to connect the two using data fed in from a Cognito form via Integromat. After the form submit trigger, I’ve got it iterating the customers, searching for the relevant Customer Record IDs and aggregating the Record IDs into a new array so the output is Array=Collection1(ID=rec…)/Collection2(ID=rec…).

It’s correctly identifying the related customers and their Airtable record IDs, but the problem comes when I try to use that information when I’m creating the records on the Other Party table. There’s a field called “Linked Customer” and I’m trying to feed the multiple identified Record IDs into the “Linked Customer” field. It works fine if there is only one linked customer but if there is more than one it’s stringing the Record IDs together as if they were a single ID.

All the necessary information is there but I can’t work out what to function/formula/structure to put into the Create Record module in Integromat that will allow Airtable to recognise them as two (or more) separate Record IDs. The instructions over at Ingtegromat say the field accepts an “Array of Airtable record Ids” and I think that’s what I’m feeding it but I must be missing something. I figure the structure of my array must be wrong somehow, or I’m supposed to use some sort of array formula when I’m trying to create the linked records? Or some separator I haven’t tried yet?

I would be grateful for any assistance :slightly_smiling_face:

16 Replies 16
ssmith
5 - Automation Enthusiast
5 - Automation Enthusiast

Just wanted to update with the solution in case anyone comes across this query in the future.

My array structure was incorrect - I was working with an aggregated array output that looked like this:

ArrayOutput

But what I needed to do was further distill the array by setting each variable and then parsing the JSON into the correct format.

In the end my Integromat modules looked like this:

IteratedAndParsed

and that produced an array with the final output that looks like this:

CorrectArrayOutput

Once I had the array formatted correctly, Airtable was able to accept the multiple linked record ids.

I think I’m struggling with the same thing are you able to share more detail?

ssmith
5 - Automation Enthusiast
5 - Automation Enthusiast

Hey Rick,
Happy to help but I don’t know what I’m doing - just a lay-user trying to force it to my will. I’ve done another similar scenario since this one and the key is definitely setting each variable and then combining them in whatever format you need. If you could share what you incoming data looks like and what you’re trying to do I could see if I could offer any pointers.

I also have a problem with arrays. Dont know how to reac an item

Would you mind posting some screenshots of the syntax of the ‘Tools’ modules? I haven’t used JSON before…

Brian_Cugelman
5 - Automation Enthusiast
5 - Automation Enthusiast

Here’s another way to manage one to many relationships in Airtable that are linked by Integromat.

The problem is that a straightforward child-to-parent update will overwrite the entire parent table linking field.
So you need to copy the parent table’s linking field array and add the new child table ID, creating a new array that you will reinsert in the one-to-many fields. So you’re not appending, but rather reinserting all links with each update.

Imagine you have a parent table with the field called “child_ids”, that links to many child records. Then you have a child table with the ID “child_id”.

When you update in integromat, you’re going to blend the parent and child table using the add function.

When updagin the one-to-many field, select “map” and type in this function: “add(child_ids; child_id)”.

Put generically “add(parent_table_field_with_many_child_ids; record_id_of_child)”. Remember, parent field is an array in integromat.

Tyler_The_NoCod
6 - Interface Innovator
6 - Interface Innovator

Friends, I just spent hours trying to solve this same problem (how to use Integromat to link multiple Airtable records to another Airtable record), and it turns out, there’s a way easier way to solve this that doesn’t involve JSON at all (that’s what I spent all my damn time trying to recreate).

Here’s my scenario:
Screen Shot 2021-04-19 at 3.27.11 PM

As @ssmith alluded to in their original post, you need to use the Tools module to change the output of the Array Aggregator module to work with Airtable. Only problem, as many people above pointed out, @ssmith never shared what they were doing with the Tools module! (or JSON, but FWIW, just avoid that altogether since it’s not necessary for Airtable linking)

Here it is:
Screen Shot 2021-04-19 at 3.29.28 PM

I figured out the map() function from this Integromat video. (Make sure to reference the “raw id” of the array item you’re trying to map).

As I understand it, we’re using map() to change the output format of the Array Aggregator from an Array of Collections to a single Array.

Array Aggregator output (before re-mapping):
Screen Shot 2021-04-19 at 3.33.49 PM

Tools output (after re-mapping):
Screen Shot 2021-04-19 at 3.34.32 PM

:point_up: This is the format Airtable needs to see when linking multiple record ID’s.

Now we insert the re-mapped array into the Airtable link field:
Screen Shot 2021-04-19 at 3.39.56 PM

I don’t understand how there haven’t been more posts about this super specific requirement with linking multiple records via Integromat. Regardless, I hope this saves you from the brain-busting struggles I just went through. :exploding_head: Good luck, friends!

Best solution, thanks

image

Vikas_Vimal2
6 - Interface Innovator
6 - Interface Innovator

Check the answer below with the ‘add’ function. It works best is this scenario.