Only pass date same or older

Hello!

Is it possible to only pass on the flow if the date is the same?

I have several payloads where there are dates in payload.date.

2023-05-25
2023-05-12
2023-05-01
2023-05-04
2023-04-25
2023-03-10
2023-04-25
2023-05-26
2023-05-22
2023-04-28

Is it possible to only pass on your payload if the date is the same or older.

eg. today is 2023-04-28 then the following should continue.

2023-04-28
2023-04-25
2023-03-10
2023-04-25

I hope someone can help me.

If these dates are string as you have shown, then a simple, less than or equal <= to comparison is perfectly viable. You can use a switch node for that.

Hello!

Thank you for your answer.

Do you have an example?

@madmax

As per @Steve-Mcl suggestion, In a switch node.

set the property to an expression.

$millis() >= $toMillis(payload.date)	

$millis = Now in ms
$toMillis = Converts a timestamp to ms

you can then react accordingly

Screenshot 2023-04-28 at 18.54.10

Thank you for your answer works great.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.