- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 03:38 AM
Hi all,
Looking for support on the correct syntax for an Inbound Email Action. We have an action in situ working, however, we now need to pass the CI (which is captured in the From field of the incoming email) into the Configuration Item field on the Incident form.
Could someone assist with adding the correct syntax to our existing script please? I believe it would be something along the lines of the below, however, I can't work out how to only pass the CI value, as opposed to all the information in the Sender field of the incoming email.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 04:14 AM
is it prefix or suffix?
if 1st letter at the start of string is to be removed then use this line
var exampleCI = inputString.split('.')[0].substring(1).toLowerCase();
if last letter at the end of string is to be removed then use this line
var exampleCI = inputString.split('.')[0].slice(0, -1).toLowerCase();
I believe I have answered your question.
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
04-08-2025 04:14 AM
is it prefix or suffix?
if 1st letter at the start of string is to be removed then use this line
var exampleCI = inputString.split('.')[0].substring(1).toLowerCase();
if last letter at the end of string is to be removed then use this line
var exampleCI = inputString.split('.')[0].slice(0, -1).toLowerCase();
I believe I have answered your question.
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
04-08-2025 08:17 AM
Hi Ankur,
Thanks for your input, below is the code for others to reference and which has led to a solution for us.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 08:32 AM
It seems you marked your own response as correct.
Would you mind marking my response as correct since it helped.
It will help to recognize the efforts I took to help you in the thread.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader