Is there a way to use now in Workflow compare timestamp?

Is it possible to use now for use in the ‘Compare Timestamp’ operator in ISC Workflows? I want to filter actions taken based on when the workflow is triggered relative to today and have so far been unable to use ‘now’ as a comparison. Is this possible?

Hi @dominick-miller,
You can get the current date in a workflow by using a “Define Variable” operator and the expression $.now().

Then you can use this date in a “Compare Timestamp” operator.

Let me know if this resolve your issue.

Regards,
Mathieu

Hi @mathieug ,

This is promising but I think I am missing context on how to use defineVariable exactly. My Define Variable config screen looks different than the screenshot you provided, as well. For example, I have a Basic/Advanced screen option. Within advanced, I have this JSON:

{
“name”: “today”,
“description”: “”,
“transforms”: [ ],
“variableA”: “$.now()”
}

and it does not seem to work. Do you know how my formatting is incorrect here?

Hi @dominick-miller,

Try this.

You can also take a look at the below thread for reference

2 Likes

@jesvin90 provided the right screenshot. You have to select “Basic”, then “Attribute” and write the correct expression $.now().

Regards,
Mathieu

Thank you both. It turns out that I was using the $.now() correctly within defineVariable, but for some reason my date comparison operator is not working as I expect. I will have to debug that, but I appreciate the help on this.