Airtable linked records can be sent throught the api?

I have 2 tables in airtable 1 is an Item and the other one is the invoice.

This is my item linked field in airtable in the invoice table

image

I want to add the item to my invoice. but when I click on create it won’t send it via the API… However, I can send it to my table by using a text field in airtable. Anyone had the same issue?

image

Have you tried using the item’s id property instead of it’s name?

Hi Ben, doesn’t seem to work… maybe because I use a dropdown to select the item?

Here’s my airtable data base if I send to a text field it works with anything (name record id) but linked records won’t let me insert something…

it won’t post to the db if I use the ID in the linked field or even the name

I’m having the same issue trying to send a Linked Record to Airtable via API. I think it might have something to do with the JSON formatting, but not sure how to modify that in Adalo. I know Airtable requires Linked Records to be formatted as [“rec1234567890”] when sending via API. I tried that formatting in Adalo, but it didn’t work.

Same here tried all sorts of formating with no success…

Relationship fields are not really supported by Adalo… I know that we can only pull the first item from the array, but are there any workarounds to add one item to an array @Ben?

1 Like

Hey @AJAY,

How can we “add the first item to the array” ? In my case, I have a linked field in Airtable, and this field will always contains one and only one record, so I’m very interested in the response :slight_smile:

I try adding the id of the record I want to link, and also some strings such as “[ ]”, but nothing worked…

Many thanks ! :pray:t2:

Ok, I found the answer by myself : use a custom action ! (works only for 1 record in an array)

2 Likes

You need to use the custom action (paid plan) in order to add the [ ] characters and add to the array.

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” ? )