Process Builder-Triggered Approval Process

Prompt

Assume we have a Volunteer Shift Worker object with a lookup relationship called “Volunteer” to the User object. This way, each User can have multiple entries in the Volunteer Shift Worker object. Further, each Volunteer Shift Worker is associated to a Volunteer Shift.

Assume an organization staffed by volunteers has been experiencing volunteer absenteeism (workers not showing up for their shift). They know this to be due to well-meaning friends and coworkers signing other people up without their knowledge. Create an approval process and the means to launch it such that if someone else signs up a given user, that user must approve the record, indicating they do plan to show up for their shift.

Solution

Prework

Ensure existence of two fields on the Volunteer Shift Worker object:

  • Status picklist:
    • Unconfirmed, Pending Approval, Confirmed, Completed, No-Show, Canceled
  • IsShiftVolunteer formula:
    • $User.Id == Volunteer__r.Id
  • Volunteer lookup to User

Approval Process

  • Next Automated Approver Determined By: None
  • Initial Submission Actions:
    • Field Update: Status -> Pending Approval
  • Approval Step 1:
    • All records should enter this step.
    • Assigned Approver: Automatically assign to approver: Related User: Volunteer
  • Final Approval Actions:
    • Field Update: Status -> Confirmed
  • Final Rejection Actions:
    • Field Update: Status -> Canceled

Process Builder

  • Start the Process when:
    • Only when a record is created
  • Decision:
    • Criteria: Conditions are met:
    • [Volunteer_Shift_Worker__c.IsShiftVolunteer__c] Equals True
  • If True:
    • Field Update: Status -> Confirmed
  • If False:
    • Always:
      • Submit for Shift Worker Approval:
        • Object: Volunteer_Shift_Worker__c
        • Approval Process: Default approval process
        • Submitter: Current User