Inbound Email Action Not working Fine in Servicenow?

siva44
Tera Contributor

Hi to All,

I have created one inbound email action  with specific condition for creation of incident and condition script like below

 

"email.subject.index("Fw:Demo Card library") == -1 && !(email.origemail == 'Alerts@group.com')"

 

But whenever i am forwared one email to servicenow with subject like FW:Demo Card library then also the inbound action triggering and with small letter for 'w' in 'Fw' then it is not triggering.

How to check the subject correctly in script

please let me known if anyone known 

1 ACCEPTED SOLUTION

Hi @siva44,

 

Looking a little more closely, not only do you need to change the 'index' to 'indexOf' as described above, can you explain what email.origemail relates to? This is not a standard column on the email table. I believe this should be 'email.from'

 

Can you try:

email.subject.indexOf("Fw:Demo Card library") == -1 && !(email.from == 'Alerts@group.com')

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.




Thanks, Robbie

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@siva44 

I think it's case sensitive.

compare for both the cases

"(email.subject.index("Fw:Demo Card library") == -1 || email.subject.index("FW:Demo Card library") == -1) && !(email.origemail == 'Alerts@group.com')"

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Runjay Patel
Giga Sage

Hi @siva44 ,

 

You can use below condition.

RunjayPatel_0-1730819112418.png

Also add identifier in property.

RunjayPatel_1-1730819158392.png

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

 

Robbie
Kilo Patron
Kilo Patron

Hi @siva44,

 

I believe you're wanting to leverage the method of indexOf in your script (not index)

 

The syntax should be as follow:

"email.subject.indexOf("Fw:Demo Card library") == -1 && !(email.origemail == 'Alerts@group.com')"

 

indexOf is case sensitive meaning it will honour and only match on the case specified.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.




Thanks, Robbie

 

 

siva44
Tera Contributor

Not working I have tried with this way also