
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2020 08:49 AM
Hi
I have a string variable where users enter names by comma separating( field name - colleagues1) and i have another variable which will store the email address of those names by comma separated.
I wrote a catalog client script and script include for this. It worked fine when the variable (colleagues1) where users are selected is a list collector but if the variable is a string, it isnt going in the loop and always just returning email address of 1st user selected.
Please find the script include -
I checked, the values are coming correctly from client script and the for loop is also running fine.
Works first time, but subsequently, it isn't going to else condition
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2020 04:47 AM
Hi,
might be some space in the name
please try this and trim the value
gr.addQuery('name', count[i].trim());
Also did you check those users are having the email with @ whatever your query is
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
‎09-29-2020 03:36 AM
No Luck

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2020 04:29 AM
Hi Chenab,
Try playing around with the addQuery which could be causing the issue.
gr.addActiveQuery();
//gr.addQuery('name', 'IN', count); //comment this
gr.addQuery('email', 'CONTAINS', '@companyemail');