Airtable linked records can be sent throught the api?

Yep exact, that’s what I’ve done and it works like a charm.
Many thanks @Ajay for this confirmation :+1:t2:

Hi @ChristopheHK do you happen to have an example of the json you’re using to get this to work? Have you been able to send date/time data successfully?

It’s a normal json, but if you want to set ONLY ONE parameter of an array, you have to hardcode the [ and ] .

You can send date, with format = Zulu timestamp (default timestamp for adalo)


Does not work

How did you solve it?

You can use Custom Action in Adalo to update in AirTable field with multiple relations ( for example guests and tags, many to many relation )

When you try to send Update Tag from Adalo to AirTable your JSON look like this:

{
fields: {
	guests_uuid: {
		0: "[recpGIq2zW32QfeLt, recc9ADs3UBnh1Zeo]"
	}
}

}

and you have a error:

{
	"error": {
		"type": "INVALID_VALUE_FOR_COLUMN",
		"message": "Value is not an array of record IDs."
	}
}

because Airtable waiting this:

   {
  	fields: {
  		guests_uuid: [
  			"recpGIqGzW32QfeLt",
  			"recUVKqWn1A2slrys",
  			"recB0DLA0gSUDVb0x",
  			"rechD1dd2u22q6UAL",
  		]
  	}
  }

and one more: in AirTable API Doc:

To link to new records in tags_uuid, add new linked record IDs to the existing array. Be sure to include all existing linked record IDs that you wish to retain. To unlink records, include the existing array of record IDs, excluding any that you wish to unlink.

the case is to send to AirTable valid JSON

i could’t find in Adalo any options to get Array or ValueList of related ids to create a valid json for custom action ( also in AirTable no formula like ArrayToJson, FilterValues or some CustomFunctions, but you can try this way:

Add value

in AirTable you can make formula field A to collect related ids and make valid json, like this

“”"& SUBSTITUTE( ARRAYJOIN( tags_uuid ), “,”, “”, “” ) & “”"

“rechH8atIgewvuauE”,“recpGIq2zW32QfeLt”

and add to your custom action value for related field

[ new_tag , field::A ]

*notice check for empty state

Remove value

in AirTable:

  • add field B to store uuid for remove

  • make formula field C to collect related ids without uuid in field B, like this

    SUBSTITUTE( ARRAYJOIN(tags_uuid), B, "")

    *notice to remove unnecessary symbols like this “,”, and check for empty states

in Adalo:
Make 2 Actions

  • default action: update field B = uuid for remove
  • custom action: update tags_uuid = field:C

it works fine, but i’m not sure that is a best way

now, i think that better to use some backend to data processing ( parsing json, working with array and etc )

I cannot get a formula like this one to work in my Airtable. It says invalid formula. Assuming I need to change tags_uuid, but to what?

sorry, some mistake in formula
this is correct

“"”& SUBSTITUTE( ARRAYJOIN( tags_uuid ), ", ", “", "” ) & “"”

"recjaXxUK860RZE0d", "recpFe0MRvQEX6H9l", "recXCmvRAMnfbDR9W", "recf7m9MHt6jOxon9", "recAxs0jeMpCHcaLY"

tags_uuid - name of your linked field in table ( “Link to Master” ? )

Still does not work, sorry. Invalid formula, even when I change to Link to Master.

sorry, in message “\” this not working when copy/paste text

Thank you so much @geullaideo ! Formatting was indeed the issue.

I ended up using the following formula:

IF(BLANK({Link to Master}),"\""& SUBSTITUTE( ARRAYJOIN( {Link to Master}), ", ", "\", \"" ) & "\"","")

In this formula, Link to Master needs to be substituted with the column linked back to the master records. I have gotten that far. I am working on the next steps now.

1 Like

glad this solution helped you )

@geullaideo In my Airtable base, my table relationship is only one to one, not really one to many. Can you offer an assistance on how I might link the two?

For example, one service request can only be attached to one piece of equipment. However, one piece of equipment can have many service requests. The way my app is set up now, somehow it is creating two Airtable records. One with the fields entered properly, and a second with empty fields, but the proper connection to the master table. I’m not sure what I’ve done wrong.

Thank you.

I appreciate your help.

@mbl79
in my case, I used the typecast = “true” method and it works perfectly using a custom action. here’s a screenshot of my JSON structure as recommended by airtable.

I have a CartID Table & CartItems Table, for every CartID there are many CartItems, so whenever a user adds an item to the cart, I send the CartItem along with the CartID (Linked record) using this typecast method.

Hope it helps.

I cannot for the life of me get this figured out. I can create a record on the service requests table, but cannot get it ‘linked’ back to the master record, even with typecast: true.

With this custom action:

It’s creating TWO records in my table. One that is correctly linked (but with no type or notes), the other that is NOT linked, but with the record information.

AAAARRGHHHHHH! What am I doing wrong?

Ok, I think I know what’s happening here.

Do this in 2 steps instead:

  1. Create a record without the linked record field
  2. Update using custom action for the record just created using PATCH and typecast method.

This might work, let me know!

I have been able to ‘log’ the record id, but no matter what I do, I can’t seem to pass the value to the linked field {Link to Master}. Is there something programmatically limiting me to doing so? I am using typecast=true.