We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to send notification based on the catalog form group variable.

raj99918
Tera Contributor

Hi ,

 

I need to send notification dynamically based on the  2 Group name variables(Group1 and Group2) from the catalog form. Who will receieve should be dynamic based on the those 2 groups from the form. How can I acheive this ?

 

5 REPLIES 5

Not applicable

@raj99918 ,

 

- Create a event using "Event Registry".

- In notification add that event under "When to send"

Sai149_0-1716490308339.png

- Check "Event parm 1 contains recipient"

Sai149_1-1716490398079.png

- In flow

 

Sai149_3-1716492197167.png

var emails =[];
var gr = new GlideRecord("sys_user_grmember");
gr.addEncodedQuery("group="+fd_data.trigger.request_item.variables.group_1+"^ORgroup="+fd_data.trigger.request_item.variables.group_2);
gr.query();
while(gr.next())
{
    
    emails.push(gr.user.email);
}

replace group_1 & group_2 with your actual variable names.

 

Please check & If my answer helped you in any way, please mark it as helpful or correct.