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 11:00 PM
The format is going to remain the same and there will be no changes to the format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2022 03:09 AM
Hi,
then I would suggest to use RegEx to extract the value instead of string manipulation
var str = 'VMM - 0000307658 - 0180';
var val = str.match(/\b([0-9]{10})/);
gs.info(val[0]);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2022 05:35 AM
Hi Vidya,
If your requirement is completed make the correct answer(Which you have used), So it will help others to use future.
if you format won't change then
Thanks
Chandu Telu