- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2023 04:48 AM
I have a requirement to send a notification to the manager of a group within a service catalog request.
Could you advise how best to achieve this with Flow Designer?
I have tried Send Email with a scripted to field with the below script however, when I have saved the flow, the script disappears
var grGroup = new GlideRecord('sys_user_group');
grGroup.query('sys_id','5cd9840a37d4dy00af525aa543990ez5');
if(grGroup.next()){
return grGroup.manager;
}
I've also tried a Send Notification action calling a notification from the Requested Item table however, it is not sending as the 'to' field is empty - I either have a problem with my mail script or it's not possible to send a notification with the 'Who Will Receive' section not completed.
Previously we have achieved this via a glide record to the user table stored as a workflow scratchpad variable in classic workflow however, we are trying to move to Flow Designer.
Any help appreciated thank you!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2023 06:40 AM - edited ‎06-27-2023 06:42 AM
Why use a script at all? You are working in Flow Designer, so don't script unless you absolutely have to.
First do a lookup record action, and find the needed group. Then use the pillpicker, to dotwalk to the manager of the group in your Send Email action.
Another way would be to use the 'send notification' action and define the recipients in the notification record. (In that case do not forget to set the trigger of the notification to 'triggered'.
Good luck!
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2023 05:07 AM
Hi @ClareM
You should keep the script part As below :
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2023 05:20 AM
Hi Rohila, thanks for the reply.
When I try to save the flow with that script, the script disappears and the To field is empty which prevents the flow from being activated.
Any idea what the issue is?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2023 05:59 AM
Once you keep the script, click on Done Button
If it doesn't work then you can delete the action and add it again.
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2023 06:40 AM - edited ‎06-27-2023 06:42 AM
Why use a script at all? You are working in Flow Designer, so don't script unless you absolutely have to.
First do a lookup record action, and find the needed group. Then use the pillpicker, to dotwalk to the manager of the group in your Send Email action.
Another way would be to use the 'send notification' action and define the recipients in the notification record. (In that case do not forget to set the trigger of the notification to 'triggered'.
Good luck!
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.