Set conditions on template level fields based on today's date
I am setting up a webform trigger that acts as a project intake form. I want to vary the instructions and additional fields that get displayed based on whether or not the Desired Completion Date is greater than 3 business days from now.
Out of the box, Catalytic's webform triggers do not currently support references to dynamic fields such as
Create a hidden field in the process that contains the date you'd like to make comparisons to, e.g.,
comparison-date. (To hide a field, set a condition true is equal to false.) Then create a separate process that uses the Pushbot: Update a process template field to set the default value of
comparison-date. Configure a scheduled trigger to run this update process at 12:00am each day.
In my sample scenario, I configured three actions in sequential order:
- Write today's date to field
- Add 3 business days to
date-nowand write that value to field
- Update the default value of
comparison-datein the main Pushbot with the recently-calculated value of
date-now-plus-3in the update process.
Then, I added conditions to all the other fields in my main Pushbot in one of two ways:
- fields["desired-completion date"] is less than or equal to fields["comparison-date"]
- fields["desired-completion date"] is greater than fields["comparison-date"]