[SalesForce] Process builder conditions when custom date/time is NOW()
Should be simple but I'm getting stuck on the formula
Building a workflow in process builder and trying to trigger an action when custom object's custom date/time field is NOW().
Best Answer
Criteria are only evaluated at the moment a record is saved. This means that your rule only works if the user saves the record with the exact second in the reminder time field. Instead, make the criteria something like NOT(ISBLANK([PFL_Showing_OLD__c].Reminder_Time__c)), then set a Scheduled Action for "0 hours after Reminder Time". Your mistake was thinking that the criteria will somehow flip to true and work automatically (a common mistake for new administrators), but that's not how Scheduled Actions (and Time-Based Workflow Rules) operate. Instead, you need to specify the criteria that should cause the action to be scheduled, then specify the scheduled action relative to the field's time value.
I am not sure if there is a variable that would allow you to do this directly in the Process Builder. There are two workarounds that i am aware of:
Create a formula field on the Process object set equal to Now() and use this to set the value.
Create a record update or insert Quick Action on the Target Object and use the pre-defined values to set your desired field to Now(). This is my preferred option as you can use the pre-defined values in the quick action manage all of your field updates while using the familiar formula builder UI.
Set the Target field equal to the Last Modified Date of the Source object. This will get you within a few seconds of Now() since the Process is triggered after the insert/update.
Best Answer
Criteria are only evaluated at the moment a record is saved. This means that your rule only works if the user saves the record with the exact second in the reminder time field. Instead, make the criteria something like
NOT(ISBLANK([PFL_Showing_OLD__c].Reminder_Time__c))
, then set a Scheduled Action for "0 hours after Reminder Time". Your mistake was thinking that the criteria will somehow flip to true and work automatically (a common mistake for new administrators), but that's not how Scheduled Actions (and Time-Based Workflow Rules) operate. Instead, you need to specify the criteria that should cause the action to be scheduled, then specify the scheduled action relative to the field's time value.