Extract a String from the Subject line in the Inbound Email Action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2022 09:41 PM
Hi All,
Please let me know how to extract the data from the Subject line of the Email in Inbound Email Action.
Subject : VMM - 0000307658 - 0180
We need to extract 0000307658 and 0180 from the above subject line.
Kindly help me as to how to extract the data from the above String value.
Regards,
R Vidya Lakshmi.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2022 09:49 PM
var subArr= email.subject.split('-');
var part1 = subArr[1];
var part2 = subArr[2];
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2022 09:49 PM
Hi Vidya,
May i know your exact requirement it can achieved in multiple ways
As @survo mentioned method you will get the 2 strings after "-"
EX: "VMM - abc0000307658 - test0180"
Answer: abc0000307658test0180
In my senario you will get only numbers in that string
var test =email.subject.replace(/\D/g,"")
Thanks
Chandu Telu
Please Mark ✅ Correct/helpful, if applicable,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2022 10:04 PM
I think you are confusing the seeker with representing my solution in a wrong way. I would request you to refrain from such kind of activities and focus on your solutions and let the user decide which solution suits them better
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2022 10:01 PM
Hi,
Are you sure the data to be extracted will be at that position only in the string?
what if the format is not the same always? then string manipulation won't work
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader