Print this page

Why is an immediate action in Process Builder not working if a Send for Approval immediate action occurs before that?

Knowledge Article Number 000212918
Description In Process Builder, the immediate action initiates an approval process (Submit for Approval) if the record meets the decision condition
One of the field used in the decision element is a field which gets updated once a record gets approved or rejection

 
Resolution This happens because the field update is not having the "Re-evaluate Workflow Rules after field change"

The explanation for this behavior is as follows:

When certain criteria are met then the TRUE condition initiates an approval (similar to user clicking on submit for approval)
Once the record gets rejected it does not meet the same decision anymore meaning the process has to be fired again
This is similar to re-evaluating workflow after a field change takes place
So not having the "Re-evaluate workflow rules after field changes" results in the action on the FALSE branching not firing

Note - It is best to have a field based on the approval as one of the criteria in the decision for the process to work smoothly

Steps to reproduce (best to test on sandbox or development environment)

Creating approval process
  • Create an approval process with 2 field update, one for approval, one for rejection
  • If a record gets approved then the Field 'Approval Response' must be set to "Approved". Similarly 'Rejected' if the approval gets rejected
  • Leave the "re-evaluate workflow rules after field changes" as unchecked in both the field update
  • Activate the approval process
Creating the process
  • In the process builder, Choose any object (in our example we will choose case)
  • Have a custom field on case prior to that called "Approval Response" with the picklist value as "Not Sent for Approval", "Approved", "Rejected". Have the "Not Sent For Approval" as default
  • In the Decision element make the choice as per business requirement (in our example we will choose 'Status Equals New')
  • Also use the field Approval Response with the criteria ('Approval Response equals Not Sent for approval')
  • In the TRUE Branch choose submit for approval immediate action
  • Choose the approval process created earlier
  • In the FALSE branching use the criteria 'Approval Response Not equal to Not sent for approval'
  • In the immediate action put in a Create a record action
  • Give the values of the mandatory fields alone for the record creation
  • Activate the process
Testing
  • Create a test Case with the criteria which will make this case enter the approval process
  • Once done you will see that the approval has already been submitted in the case
  • Reject the approval
  • Notice that the action create a record has not fired
Correcting the approval process actions
  • Go back to the 2 field updates in the approval process
  • Edit the field update and just place a check on "Re-evaluate workflow rules after field changes"
  • Run another testing and you will notice that the 'Record creation' action has fired and new record gets created




promote demote