- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 06:43 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 01:10 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 07:00 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 07:06 AM
Hi @siva44 ,
You can use below condition.
Also add identifier in property.
-------------------------------------------------------------------------
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
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 07:17 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2024 10:18 PM
Not working I have tried with this way also