Compare Dates with IF / Else in modul not Filter

Hi All,

I get 3 Dates from a modul. I have to compare with date from Today in the Modul, not in the filter.

If one of the Dates > Today I have to write X in the field.
If one of the Dates < Today I have to write Y in the Field.

I used this one:
{{if(formatDate(8.customFields.18; “DD.MM.YYYY”) | formatDate(8.customFields.40; “DD.MM.YYYY”) | formatDate(8.customFields.46; “DD.MM.YYYY”) >= formatDate(now; “DD.MM.YYYY”); “X”; “Y”)}}

But it does not work and I dont find out why. Can anyone help on this?

BG,

Welcome to the Make community!

  1. You cannot use formatDate because you are comparing Strings. Did you mean to use parseDate instead?

  2. You cannot chain the or like that and then perform the greater than or equals comparison at the end

Currently you are doing

date OR
date OR
date OR
date greater-than now

You need to change it to

date greater-than now OR
date greater-than now OR
date greater-than now OR
date greater-than now

samliewrequest private consultation

Join the unofficial Make Discord server to chat with us!

3 Likes