Help

Re: Knowing when there is a change to the record

2204 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Ken
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi, when using the API to read the stored records, what’s a good way for the client to know if there’s been updates to the content? Do we have to make the decision ourselves (ie download the whole data and compare), or is there a way to check “last updated”? Sorry if I missed that somehow.

13 Replies 13
Tuur
10 - Mercury
10 - Mercury

:slightly_smiling_face:

I’m also eagerly awaiting the MODIFIED_TIME() and Metadata API features!

But for now, here’s how I find changes:

New Records

Store the RECORD_ID() or the CREATED_TIME() for the last record your application requested. Subsequent requests can specify only records created after that record using the filterByFormula parameter.

Example filterByFormula param to get last known record:
RECORD_ID() = "a89ds790sad8f09ds8f90"

Example filterByFormula param to get records after time:
CREATED_TIME() > "2015-11-11T22:18:17"

Formula field reference

For an overview of formula fields, please refer to the Guide to Formula, Lookup, Count, and Rollup fields. Formulas may involve functions, numeric operations, logical operations, and text operation...


51aada259c4afcfdef2d0ae2df49851022c7a4de.png

Modified Records

The best way I’ve found to handle the identification of modified records is by:

  1. Identify specific fields to “watch”
  2. Request as few records as needed using filterByFormula. For example, for an events application I only retrieved upcoming events that were marked as “active”. This means my application won’t be aware of any inactive or past events, but for my application this was sufficient.
  3. Request as few fields as needed using the fields parameter. This speeds things up.
  4. Update/Patch only the fields that have actually changed. I’ve found debugging and performance to be improved by comparing each field I’m watching and building a new object/array/record using only the fields that have changed. This prevents the submission of values that have not changed and allows your debugging/console messages to be specific and informative. The alternative would be to create a hash of the entire record and if new_hash != old_hash update the whole record. This isn’t bad, just not the route I went down.
Derek_Gau
4 - Data Explorer
4 - Data Explorer

Hi are there any updates to when the ‘created date’ or ‘last modified date’ will be added to Airtable? I have seen in the generated API documentation that it is on the roadmap, but it would be great to get a more tangible update about when this feature would be coming. Thanks!

Any update? Any update at all?

Justin_Ith
4 - Data Explorer
4 - Data Explorer

@Tuur @Chester_McLaughlin Any update on this? Thanks!

Nope. You have to keep track of it yourself. :frowning:

Nicholas_Ewing
5 - Automation Enthusiast
5 - Automation Enthusiast

@Airtable_Team Would love to see this feature as well!

EUGENE_GONCHAR
5 - Automation Enthusiast
5 - Automation Enthusiast
  • 1 for timestamp of record modified feature
Oli_Steadman
7 - App Architect
7 - App Architect

I’ve heard that they are now finished with the beta testing of this feature and that it is being released soon. Exciting times.

Jonah_Stiennon
4 - Data Explorer
4 - Data Explorer

I don’t suppose there’s plans for a websocket API where we can get change events?

Charlie_Martin
5 - Automation Enthusiast
5 - Automation Enthusiast

I’m trying to fetch recently modified rows via the API. Seems to me that this should work, but it doesn’t return any rows…

filterByFormula: "LAST_MODIFIED_TIME() > '8/17/2019, 7:36:49 PM'",

what am I doing wrong here?

I tried this and it actually worked

we are using curl api

url: '<AIR_TABLE_API_URL>/<APP_KEY>/<APP_NAME>?maxRecords=10&view=Master%20View&filterByFormula=CREATED_TIME%28%29%20%3E%20%222019-08-27T22%3A18%3A17%22

filterByFormula=CREATED_TIME%28%29%20%3E%20%222019-08-27T22%3A18%3A17%22

//
this is url encoded version of

CREATED_TIME() > “2019-08-08T22:18:17”

Charlie_Martin
5 - Automation Enthusiast
5 - Automation Enthusiast

Thank you!!! The issue was the date format.

Where did you find out what date format to use? I saw the API seems to return dates in this format ‘8/17/2019, 7:36:49 PM’, but it accepts them in this format ‘2019-08-08T22:18:17’. I can’t find any documentation on this at all.