- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 06:17 AM
Looking up a sys_user record using the following results in a successful look up.
However, using the following results in 'No record found'
'Extract string email address 1>email' is the output from action...
(function execute(inputs, outputs) {
var inputstring = inputs.string
/*extract email address from string with line containing Email: email address*/
var startindex = inputstring.indexOf("Email:");
var endindex = inputstring.indexOf("Dept:");
var email = inputstring.substring(startindex+7,endindex);
outputs.email=email
})(inputs, outputs);
...where inputstring is...
FormID: 65
UserID: NHSH\seagl01
Logged-in as NHSH\seagl01
Name: Scott Eaglesham (NHS Highland)
Email: scott.eaglesham@nhs.scot
Dept: eHealth Services
Execution details as follows...
I have tried with action output variable 'email' as String and Email types, with the same result.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 07:34 AM
Hello @Scott Eaglesham ,
I guess the issue is whitespaces can you try:
var email = inputstring.substring(startindex+7,endindex);
It will remove all spaces if there are any!
Kindly mark the answer ✔️ Correct or Helpful ✔️ If it addresses your concern.
Regards,
Siddhesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 06:19 AM
change operation to look up records. from look up record
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 07:02 AM
Many thanks for the prompt response.
Using Look Up Records results in the following.
Also, what I' m actually trying to do is to look up the user record with the specified email address to use to set the caller_id in an incident record in a subsequent stage in the flow. Will Look Up Records allow me to do this? I can do so using Look Up Record with condition email=scott.eaglesham@nhs.scot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 07:08 AM
Yes @Scott Eaglesham
Look up record will work.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 07:32 AM
I'm afraid I'm getting the same result using Look Up Records as I do using Look Up Record. In both cases using the action output variable, email, in the condition results in no records found, and setting the email field explicitly to an email address in the condition results in a record being found.