8

I've been testing this in a trailhead org to confirm/test behavior within Process Builder. This means there's no other automation/code/trigger on the object I'm testing on.

Is it possible to have one action update a field that would trigger a scheduled action within the same process builder on creation of a record?

It seems if I do the following on create/update of a record:

  1. criteria node: always set a string for a specific field
  2. criteria node: if specific field is not null, post to chatter immediately and have a separate scheduled action to post to chatter a different message

enter image description here

What happens: I've been testing with creation of the record.

  • The immediate chatter post occurs
  • The scheduled chatter post does not.

I've tested back-dating the scheduled action (so that it would fire as soon as possible), but it also didn't occur. It's also not appearing in the paused flow interviews at all.

I'm trying to figure out why this happens.

  • The criteria in the 2nd node is being met (the immediate action occurs)
  • The criteria in the 2nd node is never changed to not be met (no other updates, field is still not null).

Out of interest, I've tested other scenarios as well

  • When I selected "yes" for recursion for the process builder, it had 6 chatter posts from the immediate action and 5 scheduled action chatter posts.
  • When I remove the field update from the PB and simply create a record with a value for that field in the UI, it works.
  • When I remove the field update from PB and do it in a trigger (before insert), it works.
  • If I separate out the scheduled action criteria/node into its own separate PB with the same exact configuration (create/update, same criteria), it works.
2
  • do you get different results if the scheduled action uses a date field other than a system audit date field?
    – cropredy
    Commented Jan 28, 2020 at 1:42
  • Just tried and same result. I've also tried back-dating and forward dating whatever date field I use and also see the same behavior. Commented Jan 28, 2020 at 1:51

1 Answer 1

3

After working with Salesforce Support, the conclusion is that what I noted is buggy or unpredictable and there's a critical update to stabilize this behavior that will make it so you can not use a field update to meet the criteria of another node in the same process builder.

The critical update that will auto-activate in Summer ’23 (has been pushed back many times so check release notes) is Evaluate Criteria Based on Original Record Values in Process Builder. The Update Summary for that critical update mentions

This update fixes a bug with the evaluation criteria in processes that have multiple criteria and a record update.

As well as providing a longer description when you Review it.

Prior to the Summer ‘19 release, processes evaluated the updated value on the record that began the process, instead of the original value.

Specifically, for any process that had multiple criteria and a record update, process builder evaluated the updated value of any field that had an original value of null when the process began, instead of evaluating the original value.

This update resolves the issue.

Processes with multiple criteria and a record update now evaluate the original values of the record that began the process.

If you have a process with the Do you want to execute the actions only when specified changes are made to the record? option selected, or uses the ISCHANGED() function in your criteria, this update may cause the process to behave differently.

We recommend that you test this update in a sandbox or Developer Edition organization to make sure your processes work correctly before you enable it in your production organization.

Once this is activated, the behavior that is expected is that you can not do what I proposed in the question. The process builder will evaluate the record as it was when it entered the process and not take into account any updates you make in previous criteria nodes.

This is currently noted in the trailhead regarding order of process criteria

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .