Help

Using API to link a date field in local format

Topic Labels: API
Solved
Jump to Solution
3720 7
cancel
Showing results for 
Search instead for 
Did you mean: 
Mike_Wilson
5 - Automation Enthusiast
5 - Automation Enthusiast

Our calendar table has a primary field of type datetime with the local format
When using the API to update a link record in our bookings table with the recordId from the calendar, it is displayed in the US format
image
A linked table shows the local format, it is just the lookup table that is wrongly presented
In the picture above 3rd record we copied and pasted the date which is then the correct format
Is this a bug?

1 Solution

Accepted Solutions
Mike_Wilson
5 - Automation Enthusiast
5 - Automation Enthusiast

Thanks for your reply. Re the previous message - I contacted Airtable support, who responded quickly. Confirming it looked wrong and are investigating
They suggested trying “European” format - which works - so just an issue with “local”

See Solution in Thread

7 Replies 7

Hi @Mike_Wilson,

Welcome to Airtable Community! :slightly_smiling_face:

When sending the data using the API send it in the ISO date format, it will then be formatted automatically into the format you specify in the Field. Any other way will create wrong dates (and I have tried it a lot!)

If this helps you, Please mark it as Solution so others can see it.

BR,
Mo

Mike_Wilson
5 - Automation Enthusiast
5 - Automation Enthusiast

Thank you for your help - Just to be clear

I am using ISO date format when creating the primary field of Table1 (this works OK)
I remember the recordID of the newly created record

Then in Table2 I set the linked field to the RecordID (from table 1) - this is displayed incorrectly

Are you saying I should not use the recordID, instead I should use the ISO date?

Mike

There shouldnt be any difference between the Record name in the primary field of Table 1 and what is displayed in the Linked Record field. What im seeing is this creates another record in Table 1 with this “new” name, can you check if the record with the wrong name actually links to the correct record?

I would choose the date from the list that pops up when you click on the plus button in the Linked Field.

Mike_Wilson
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi, I tried updated the linked field as a ISO date but get the following
“Value is not an array of record IDs.(INVALID_VALUE_FOR_COLUMN)[Http code 422]”

To answer you question, Yes they are linked correctly
Please look at the picture at the top of the thread - some of these dates are impossible
9/23/2020 is US format
27/5/2021 is UK format
They are all UK format in Table A

The error message you listed confirms what you asked about earlier: links should be sent as an array of record IDs. Some integration systems use internal methods that let the user pass the name in the primary field of the linked record instead of its ID, but the API requires the ID.

If you haven’t already done so, I strongly suggest taking this question to Airtable support.

Hi @Mike_Wilson - yes this does look like a bug. I’m getting the same behaviour as you when creating a linked record via the API (using the record id for the calendar record):

Screenshot 2020-07-21 at 17.29.33

The linked field has no format options and doesn’t seem to pick up the underlying format options of the date field. Side note, if you change the format in the root table, then all of the dates reset their format, but this isn’t a very usable workaround:

Format reset to ISO:

Screenshot 2020-07-21 at 18.14.29

Then reset to local:

Screenshot 2020-07-21 at 18.14.43

Mike_Wilson
5 - Automation Enthusiast
5 - Automation Enthusiast

Thanks for your reply. Re the previous message - I contacted Airtable support, who responded quickly. Confirming it looked wrong and are investigating
They suggested trying “European” format - which works - so just an issue with “local”