Help

Filter where {date) is equal 2 days from today

Topic Labels: Integrations
Solved
Jump to Solution
4262 5
cancel
Showing results for 
Search instead for 
Did you mean: 
Pjero_Kusijanov
7 - App Architect
7 - App Architect

Hello, can anyone suggest how to create a filter where {date) is equal 2 days from today. The {date} is from Airtable and it is a lookup field.

This will send email to client 2 days after the service was provided.

Thank you for help

1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

Thank you for explaining that you are using Integromat. I thought you were using the Standard REST API because this is posted in the API section of the forums.

If you want Integromat to process records 2 days after the “Check-out” date, and “Check-out” is a date field in your table, you need to have Integromat look for “Check-out” dates that occured 2 days before the current date.

Your Integromat formula to add days is adding 2 days to “now”, which will result in a date that is two days after today. For example, today is June 2. The addDays(now;2) function will add two days to June 2, and come up with June 4. However, you really want to process a record that was check out two days ago on May 31. To fix this, try subtracting 2 days. (You may need to add a negative 2 instead of subtracting.)

You may also have some difficulty with comparing dates because the you are testing the “Check-out” value (which is probably a date/time object with a time) against a text string that has no time.

I suggest you calculate the difference between the two dates (“check-out” and now) and see if the difference is what you want. Here is the documentation for Integromat’s date/time functions.

See Solution in Thread

5 Replies 5

Lookup dates can be tricky to handle. The lookup value will be an array. However, since you don’t need to get the actual date, you might not have to deal with that array.


You could create a view that does the filtering for you, and then get the records from the view.

image


Or you could use filterByFormula in your API call. The filter that you pass should be identical to a formula that you could enter in the user interface. You will need to url encode it as part of your query url parameters. The API documentation has the details.

DATETIME_DIFF(date, TODAY(), 'days') = 2

On the other hand, these formulas will always return dates that are two day in the future. If you want to send an email two days after the date, you should be looking for dates that were two days ago . In that case, just adjust the filter to “days ago” or the formula to -2.


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?

I do not quite understand. In integromat scenario I have the Search module that searches for records and then it process the records if they are 2 days after “Check-out” date.
Screen Shot 2020-06-01 at 10.31.15

This is the filter I tried but id does not work.
Screen Shot 2020-06-01 at 10.31.24

In airtable this is the table with look up field {Check-out}.
Screen Shot 2020-06-01 at 10.36.49

So if {Check-out} is June 1st the record should pass through filter on June 3rd.
note; Time does not matter,

kuovonne
18 - Pluto
18 - Pluto

Thank you for explaining that you are using Integromat. I thought you were using the Standard REST API because this is posted in the API section of the forums.

If you want Integromat to process records 2 days after the “Check-out” date, and “Check-out” is a date field in your table, you need to have Integromat look for “Check-out” dates that occured 2 days before the current date.

Your Integromat formula to add days is adding 2 days to “now”, which will result in a date that is two days after today. For example, today is June 2. The addDays(now;2) function will add two days to June 2, and come up with June 4. However, you really want to process a record that was check out two days ago on May 31. To fix this, try subtracting 2 days. (You may need to add a negative 2 instead of subtracting.)

You may also have some difficulty with comparing dates because the you are testing the “Check-out” value (which is probably a date/time object with a time) against a text string that has no time.

I suggest you calculate the difference between the two dates (“check-out” and now) and see if the difference is what you want. Here is the documentation for Integromat’s date/time functions.

I have manage to solve this by adding formula in search module and then created filter that will process the scenario if number of bundles are greater than “0”.
DATETIME_DIFF({Check-out},TODAY(),‘days’)=2)

Thank you for your input.
This works well.

For clarity purposes, I’m moving this to a different category.