- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2022 02:22 PM
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.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2022 09:52 PM
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
Mohit Kaushik
ServiceNow MVP (2023-2025)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2022 09:12 PM
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
Mohit Kaushik
ServiceNow MVP (2023-2025)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2022 07:38 AM
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
Mohit Kaushik
ServiceNow MVP (2023-2025)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2022 01:05 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2022 09:52 PM
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
Mohit Kaushik
ServiceNow MVP (2023-2025)