Expand my Community achievements bar.

How to query for $$TODAY's date using Fusion

Avatar

Community Advisor

Dear WF community,
does anyone what would be equivalent of a wildcard filter plannedStartDate==$$TODAY in Fusion?

suggestions will be greatly appreciated.

And secondly, maybe even more importantly, how to offset this by user's timezone?

what is today for Someone in Tokyo is not necessarily the same for someone in San Francisco

 

My guess is it will have to be double condition with gt and lt conditions around exact start and end time.

let me know what you think

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

4 Replies

Avatar

Level 9

In Fusion, you would want to look in the 'Date and time' config menu for those options. The option 'now' will get you the exact date/time stamp, and then I'd wrap it in a formatDate to format it to match whatever date you're comparing against. Remember to format both dates you're working with to be in a comparable format/timezone.

 

If you're working with fields that are already typed as date, that should work. If you're working with other fields/strings that happen to contain date information them, you may need to also use parseDate first so that Fusion understands the information is a date value. 

KatherineLa_0-1719842694575.png

 

Avatar

Level 10

Hello Rafal,

 

in Fusion you can use 

 

{{formatDate(now; "YYYY-MM-DD")}}

 

lgaertner_0-1719843463765.png

 

to achieve a search query similar to 

 

plannedStartDate==$$TODAY

 

 

Regards

Lars

Avatar

Community Advisor

thanks @lgaertner @KatherineLa !
I made some progress with my challenge, now it became how to correctly combine 3 OR statements where each one has AND in it, roughly:

 

1 AND 2

OR

3 AND 4

OR
5 AND 6

 

how to put it in Fusion?

Avatar

Community Advisor

To your original question, you can just pass $$TODAY in for the date in the query string. If you want to change the value to another time zone, you can use the "formatDate" function with the list of time zones in the tz identifier column (link: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). I'm not promising they're all going to work from that table, but the few I've needed have worked from that table.

 

For making or searches, you would do 

?field=1&field=2&OR:1:field=3&OR:1:field=4&OR:2:field=5&OR:2:field=6

 

replacing the fields and numbers with whatever your criteria would be.