- 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 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 07:43 AM
That works. Thanks, both, for your prompt responses 😊