Help

Filter by Formula in the last 1 day

Topic Labels: Formulas
Solved
Jump to Solution
3297 4
cancel
Showing results for 
Search instead for 
Did you mean: 
Cory_Mayfield
4 - Data Explorer
4 - Data Explorer

I’m trying to list all records using the Airtable API that have been updated in the last 24 hours. This job will run each day and check for the last modified column and if the date `IS_AFTER(TODAY()-1 DAY, TODAY()).

I’m struggling with the syntax. Does anyone have any guidance on this?

1 Solution

Accepted Solutions
andywingrave
10 - Mercury
10 - Mercury

Hey - I can help you with the syntax - but I just wanted to say that i’ve found best practice to actually be to create a field for last updated (choose the fields you want to trigger on too) and then create a view for all the records that have been updated in the past 24 hours. You can actually just send a request with this view instead of using the formula.

Here’s the formula I think you need, though if you’d prefer to use that method :slightly_smiling_face:

IS_AFTER({Last Update [Zap]}, (DATEADD(TODAY(), -1, 'days')))

See Solution in Thread

4 Replies 4
andywingrave
10 - Mercury
10 - Mercury

Hey - I can help you with the syntax - but I just wanted to say that i’ve found best practice to actually be to create a field for last updated (choose the fields you want to trigger on too) and then create a view for all the records that have been updated in the past 24 hours. You can actually just send a request with this view instead of using the formula.

Here’s the formula I think you need, though if you’d prefer to use that method :slightly_smiling_face:

IS_AFTER({Last Update [Zap]}, (DATEADD(TODAY(), -1, 'days')))

Thanks! Wondering how the syntax you mentioned works. What is the {Last Update [Zap]} part? Is that the column name?

Oh! Yeah - That’s whatever column name you’re using with the last updated field type

In your formula, you are trying to subtract a day but your method of subtracting one date is problematic.
IS_AFTER(TODAY()-1 DAY, TODAY())

To add a day to a date, you need to use DATEADD().

However, since you are comparing dates, I recommend using the DATETIME_DIFF() function instead. Just be careful with the order of your dates, as the order of the dates determines if you get a positive or negative difference

Both of these functions are documented in the formula field reference.


If this answers your question, please mark this post as the solution. Otherwise, could you please give a bit more details and a screen capture?