How to trigger approval based on the Field in Catalog form ?

Anuj30
Tera Contributor

Please help to solve the problem.

Client need a workflow as if user select the name in form then the approval will be trigger to that person.

for example: in picture if user select Finance and HOD. then approval email will need to go to Finance and HOD.

 

find_real_file.png

1 ACCEPTED SOLUTION

Hi Anuj,

If that is the case then you need to create 3 different approval - user activities in your workflow. Each one will trigger approval to one- one user based on your sequence first to HOD, Finance, Director and MD.

In your first approval activity you can send the approval to HOD variable and once approved then you can send it to Finance and so on. And the reject case also you can handle easily.

An approval-user activity will have to outputs, Approve and Reject. So based on your requirement you can map them with other activities.

 

Please mark this as helpful.

Thanks,
Mohit Kaushik
Community Rising Star 2022

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)

View solution in original post

5 REPLIES 5

Mohit Kaushik
Mega Sage
Mega Sage

Hi Anuj,

You can create an activity in your workflow and by using advance script this can be achieved.

Activity name: Approval - User.

Advanced check box - checked.

Script as shown below:

answer = [];
if (current.variables.u_hod != '') {
    answer.push(current.variables.user_1);
}
if (current.variables.u_finance != '') { // variable names you need to enter correctly
    answer.push(current.variables.user_2);
}
// and so on if more you want to add.

 

Please mark this as correct and helpful if it resolved the query or lead you in right direction.

Thanks,
Mohit Kaushik
Community Rising Star 2022

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)

Hi Anuj,

Did you get a chance to look into my suggestion? If your query is resolved then please mark the question as correct so that it can go from unanswered thread and others can get benefited from the same.

 

Thanks,
Mohit Kaushik
Community Rising Star 2022

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)

Anuj30
Tera Contributor

Thank you Mohit, It's working but it is not triggering approval notification in a sequence

for example first HOD second Finance and Third Director and last MD.

At present it is triggering to all at same time with out sequence,

Please suggest if it is possible.    

Hi Anuj,

If that is the case then you need to create 3 different approval - user activities in your workflow. Each one will trigger approval to one- one user based on your sequence first to HOD, Finance, Director and MD.

In your first approval activity you can send the approval to HOD variable and once approved then you can send it to Finance and so on. And the reject case also you can handle easily.

An approval-user activity will have to outputs, Approve and Reject. So based on your requirement you can map them with other activities.

 

Please mark this as helpful.

Thanks,
Mohit Kaushik
Community Rising Star 2022

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)