Script in Workflow -to send approval request to the Approver selected from a Group can only approve

Sumit Mahto
Tera Contributor

I'm having an IT_TLT group. An approver let's say "ABC" is selected from this group and now the approval request along with an approval notification should go to this approver "ABC" only not to the whole group. I need a script for geeting this done using workflow as the selection of approver is based on it's selection in the portal by the user.

15 REPLIES 15

Pavankumar_1
Mega Patron

Hi @Sumit Mahto ,

do you have any specific field to tell about the approver from your group?

If Yes then you can use it.

If you don't have field then how you know which user is selected?

 

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

Yes a select box field is there. This field contains all the approvers from the group IT_TLT. And when anyone of the approver is selected then Approval request should go to that approver only. 

 

SumitMahto_1-1702367087049.png

 

Hi @Sumit Mahto ,

If it is catalog item then you can use the Flow and use Get Catalog Variables action and use that in Send Email.

 

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

Hi @Pavankumar_1 ,

I had used variable with name "select_tlt_approver". And in the question choices I had added the all the approvers of the Group "IT_TLT".  Now using the workflow I want to send notification and approval requested to the approver whose name selected in the portal. For that I'm using Notification and Approval activities but the notification and approval request is not going to that approver.

Though using the gs.log(); I can see the approver name is getting captured in the workflow but it is not pusing it for the approval request and notification. I need some script to do this. As I tried with every possible conditions. Or could you suggest some ways by which I can get the results. 

It will be a very great help to me.