I'm stuck on a workflow condition. We have a custo...
# general
j
I'm stuck on a workflow condition. We have a custom date field on our record. The logic is that if the custom date field is today or before today, then it goes to state 2. If the custom date field is after today, it would go to state 3 instead. My current logic is on the transition and using a formula: For transition to State 2: ROUND({today}-(customdatefield})<1 For transition to State 3: ROUND({today-{customdatefield})>=1 It keeps just going to state 2 no matter what. Does someone know how the formula should be written?
m
You could make a saved search that has the criteria you want then use that as the condition of your transition
Also if you want to write the condition in the WF have you tried {today} < {customdatefield} and {today} >= {customdatefield}
Also if you turn on logging is the log showing an error of some sort?
j
@MGBC The formula you provided didn't work. The logging just shows TRUE or FALSE and I don't know why it's not working. I was trying to avoid using a saved search
m
Maybe try to create a WF field called date variance. Then use a Setfield value action with a formula of {today} - {customdatefield}
👍 1
Then in your transition use the visual builder to say {wf_datevariancefield} is less than 1
(or whatever values work for your condition)
Then you are evaluating a single numerical field instead of trying to do a calculation of 2 fields in the formula