How to dynamically set the "To" person in a Send Notification action in Flow Designer

gjz
Mega Sage

Hello,

I need to dynamically set the "To" person in an email and I can't figure out how to do that from Flow Designer. In my situation, it's a bit more complicated.

 

My business requirement is to find inactive users based on a time period.  The liaisons (yes, plural) for the department are to be notified of the inactivity.  All of the inactive users are captured in a .xlsx spreadsheet that is attached to the RITM.  The liaisons do not have access to the RITM, they are not ITIL fulfillers.

 

I am able to get the liaisons' sys_id into an array and I confirmed the array worked with a Send Email action.  However, I can't use Send Email because of the attachment, I have to use Send Notification.  But, Send Notification action doesn't have an option for me to say who it goes to dynamically.  Does anyone know how I can combine a dynamic "To" receiver with the attachment in the email?

2 REPLIES 2

Swapna Abburi
Mega Sage
Mega Sage

Hi @gjz 

I think "Fire Event" flow action should help for your requirement. Create an event in event registry and use "Fire Event" action to trigger the event.

Notification trigger condition would be when event is triggered. This way you can pass recipients' details in event parameters.

kaushal_snow
Mega Sage

Hi @gjz ,

 

In Flow Designer, because the Send Notification action binds to a fixed Notification record (with static recipient settings), you can’t directly inject a dynamic To list, but you can mimic it by looping over your array sys_id and firing the Send Notification action per user (or injecting dynamic logic into the notification email script), or alternatively use the Send Email action (which supports dynamic recipients and attachments) or trigger a custom event and notification with recipient lookup logic.....

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/