Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Need Suggestions to Resolve Inbound email Trigger Conflict in flow designer trigger condition

Saranya Babu1
Tera Expert

Hello Team,

 

Could someone suggest a way to resolve the following issue?

We have a requirement where, upon receiving an email, we need to create a normal case in ServiceNow. This is a generic condition for us. However, another team has a different requirement: when they receive an email, it should create an HR case.

Currently, there is a conflict because when an email is received, the first condition always executes.

One possible solution is to add a condition like recipient != "specific email ID". However, this approach requires frequent updates whenever new mailboxes are added, which is not ideal.

Is there a better way to handle this?
Can we use a Script Include function in the trigger condition so that adding conditions can be simplified? Ideally, we could manage this through properties, making it easier to add new email IDs without modifying the logic repeatedly.

Any suggestions or best practices would be greatly appreciated.

Thank you!

 

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Saranya Babu1 

yes you can call script include function from condition field

You will see many OOTB inbound actions doing this

AnkurBawiskar_0-1764063743667.png

AnkurBawiskar_1-1764063767825.png

 

  • You can call script include from condition and create a property to hold the email addresses, then compare and return true/false
  • if condition is true inbound action executed

💡 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

Yes I can see this Inbound email action but flow designer its not working

@Saranya Babu1 

you can't use script include in flow trigger condition if that was your ask

You can create a flow variable of type True/False

Then use "Set Flow Variables" flow logic to set the value

There you can call your script include

Then use IF flow logic and if the flow variable is False -> end the flow

💡 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

Hemanth M1
Giga Sage
Giga Sage

Hi @Saranya Babu1 ,

 

Do you have unique identified between these to endpoints other than recipient?, from, origin


I would go with classic inbound email action to have more control to check - From, Origin, use script include in condition and also use "Stop Processing" option to not to run any other inbound action if this triggered.

 

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025