Approval Process

Dawn Tabor
Tera Contributor

I'm a new ServiceNow administrator as a heads up -

 

I'm trying to build a basic approval process for all of our requested items(created as a subflow possibly to use in other RITMs that need approvals). The way it needs to flow is an email will go out every day to the approver until they approve or reject the request. After 14 days, the request will be cancelled, and an email will go out to the submitter stating that the request has been cancelled. Can someone provide me a good step-by-step best method to make this work? I have been trying to build this out in Flow Designer and have had little success from the Youtube tutorials I've seen. Any help is appreciated.

3 REPLIES 3

Najmuddin Mohd
Mega Sage

Hi @Dawn Tabor ,

 

Here's the solution.

NOTE: Attaching the complete update set of it. Retrieve this update set and associate it to any catalog item.
I have only used the conditions of IF APPROVED, you can the conditions of IF REJECTS also.

1. Create a Flow, 

Select "Do the following in Parallel"

Here, you will be running two paths.

A. the timer of 14 days - If met "End Flow".

B. Send the approvals until approved untill approval is approved. - If approved "End Flow".

So, from the above if any one completes, the flow completes.

 

Now,
2. The approvals are sent using the Subflow with Input as Requested item record.

Here also you will be selecting "Do the following in Parallel".

C. the timer of 1 day - If met "End flow" 
D. Ask for Approval - If Approved - Updates the RITM approval as Approved.


If C executed, that is 1 day completed, then flow ends and comes back to main flow and updates this approval record as no longer required using a Custom action and sends a new approval, since the approvals are sent until it is approved.

 

If D excecuted, that is, if approved, update the RITM approval as Approved.

To execute this, the following are required.
1. Flow
2. Subflow - approvals

3. Action - to update the approvals which completed today with no response as No Longer Required.

First Create an Action Name: Update Approvals, with a String field mandatory as a sys_id will be passed to it.

NajmuddinMohd_0-1726697867604.png

 

Next, click the plus icon below inputs and select script and do the following.

NajmuddinMohd_1-1726697937887.png

 


Now, it's time for Subflow.
Name:  Ask for approval community

inputs: 

Label: Request Item

Name: request_item

Reference: Reference.Requested Item
Mandatory : True

Select actions: "Do the following in Parallel"

                                 --        Wait for 24 hours. (Use 1 Min for testing)
                                            End subflow.

                                 --         Ask for Approval

                                             If approved,

                                              Select Action - Update record 
                                            Record - the input value, Table: sc_req_item, Approval: Approved.
                                            End subflow.

NajmuddinMohd_2-1726698359255.png

NajmuddinMohd_3-1726698390384.png



Now, it's final to create a flow.

 

Trigger: Service Catalog
Action ; Do the following in Parallel

             -  Wait for 14 days (Use 5 min for testing)

                 Update the RITM as Rejected

                 End flow

 

             - Do the following 

 

                      Call the subflow created : Ask for approval community
                       Call the custom action created: Update Approvals
            

                 Until, Approval is Approved (pull the data picker of approval field of request item record).
 

NajmuddinMohd_4-1726698668974.png

 

NajmuddinMohd_5-1726698688858.png

NajmuddinMohd_6-1726698704551.png

NajmuddinMohd_7-1726698718220.png






If this information helps you, kindly mark it as Helpful and Accept the solution.

Regards,
Najmuddin.

HI @Dawn Tabor ,
Did the above solution made the requirement ?

nik_au
Tera Contributor

Would suggest creating a flow that executes daily(outside business hours wherever possible) with the following high level steps - 

1. Look up records action  - Table - sysapproval_approver, Condition. Created is greater than 24 hrs ago and less than 14 days ago and state in Pending approval, and source_table is sc_req_item

2. For each record in step 1

3. (in for each loop). Send Email - Configure the email as required.

4(outside of for each loop). Look up records action  - Table - sysapproval_approver, Condition. Created is greater than  14 days ago and state in Pending approval, and source_table is sc_req_item

5 For each record found in step 4

6 - This will depend on what you wish to do, Something like Update record, Mark state as rejected and requested item>additional comments as "The approval has not been actioned within 14 days as per business process. Please consult with the approver and re-submit the request if required), 


Things to note: If the person has 10 pending approvals , they will receive 10 separate emails, A way to avoid this would be to start on the sys user table and for each user do a lookup of approvals.