How to send approval notifications with users name selected in List collector variable , based on their department for catalog

Madhu mukherjee
Mega Expert

We have a list collector field 'requested for'.

Based on the selected users' department, need to trigger notification to different approver group. And in the mail we want the respective requested for user name as well.

Any idea would be helpful.

 

Thanks!

Madhu

1 ACCEPTED SOLUTION

Hi Madhu,

So are you saying you are having say 3 users in list collector; these 3 users belong to 3 different department and based on department email should trigger to individual group?

How are you triggering the email? is it from workflow notification activity?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

9 REPLIES 9

Joaquin Campos
Mega Sage

Hi Madhu,

I think this can be achieved in an approval group activity in the workflow.

Here just as an example, you need to retrieve the department of the requestor and based on that select your proper approval group.

Then you just need to fill in the answer variable with the proper user/groups in a comma separated format (something like: answer = current.request.requested_for, approval_group1, approval_group2....). You can also return an array with the different approvers. Please check the OOO comments in the code below:

find_real_file.png

 

Hope it helps!

 

Joaquín

Madhu mukherjee
Mega Expert

Hi Joaquin,

 

Thank you! 

In the workflow activity I added like this

find_real_file.png

Now the notification is going to the approval groups.

But in the notification body, I want to write the respective user's name.

So our case is:

Our user field is a  list collector 

user: {x,y,z,k}

If the user is selected as x, the dept is x, the approval group should be A

If the user is selected as y, the dept is y, the approval group should be B

And in the notification sent to A, user name should be mentioned as x

      in the notification sent to B, user name should be mentioned as y

 

The question is, is it possible? If yes, how?

  With the above logic, the notification is going. But in the notification, right now we are populating whole details of 'user' field, not that specific user for which the approval notification has gone!

 

Hope my question is clear! Any help is appreciated!

Thanks!

Madhu

Hi Madhu,

 

Yes, that should be possible updating the notification that is triggered.

Here an example of the out of the box email notification "Catalog Approval Request". You'd need to specify the conditions in "When to send" tab:

find_real_file.png

And then specify the body in "What it will contain" tab, making use of the available fields, such as requester, approver...

 

find_real_file.png

In your case, I think best option would be to create different notifications where you specify the different conditions and then a common email template that all notifications can use.

Hope it helps!

Joaquín

Hi Madhu,

So are you saying you are having say 3 users in list collector; these 3 users belong to 3 different department and based on department email should trigger to individual group?

How are you triggering the email? is it from workflow notification activity?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader