dynamic Inbound action trigger condition

hoathong99
Tera Contributor

Hi, I am currently working on integrating SN with email. In this case, I have a group call HR with their group email, I want to make an inbound action to create a custom HRcase record but I am stuck at the action trigger. I want the action to run when the recept is HR's group email instead of a fixed email so I don't need to update the action config everytime they change their email. Is it possible with the execution condition field?

hoathong99_1-1764236698449.png

 

1 ACCEPTED SOLUTION

lauri457
Giga Sage

It's possible in the scripted condition field. You have access to the target record with the current variable. You might fit the script in the field or you can create a script include that returns the email address of the group 

email.recipients.indexOf(new YourScriptInclude().getHRGroupEmail(current.getValue("assignment_group"))) > -1;

 

View solution in original post

2 REPLIES 2

lauri457
Giga Sage

It's possible in the scripted condition field. You have access to the target record with the current variable. You might fit the script in the field or you can create a script include that returns the email address of the group 

email.recipients.indexOf(new YourScriptInclude().getHRGroupEmail(current.getValue("assignment_group"))) > -1;

 

Ankur Bawiskar
Tera Patron
Tera Patron

@hoathong99 

since it's inbound action of type NEW you don't have access to the target record

do you want to create the HR case only when email is coming from particular email?
if yes then you can give this in condition

AnkurBawiskar_0-1764568538118.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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