- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Everyone,
I have one requirement.
Requested for field is list collector type in Catalog item .if select multiple users then selected users related mail address are should populate in Task des under RITM.
For this i want script in Task event in Workflow.
How can i fix this problem
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
so email addresses of those users should be populated where?
Example: I am taking description field for my reference, you can use this advanced script in Create Catalog Task Activity
var myArray = current.variables.listCollectoVariableName.toString().split(','); // give your variable name here
var emailArray = [];
for (var i = 0; i < myArray.length; i++) {
//myArray[i];
var gr = new GlideRecord("sys_user");
gr.addQuery("sys_id", myArray[i]);
gr.query();
if (gr.next()) {
emailArray.push(gr.getValue('email'));
}
}
task.description = 'Email addresses are ' + emailArray.toString();
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
3 weeks ago
I believe I took example of description field and you can enhance the logic further now.
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
3 weeks ago
I believe I took example of description field and you can enhance the logic further now.
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
3 weeks ago
Thanks for Your solution Ankur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Ankur,
is it possible to set limit to select users in List collector type requested for variable?
Thanks,
Manohararuna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
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/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hello Ankur,
actually it takes time to select users this way.
Since we might on-board more than 100+ users during different Go-live process, this process of manually selecting each user will not be feasible for us.
We would like to have an BULK upload option so that we shall upload an excel file with all the users email & place the request.
Please Provide solution to this way.
Thanks,
Manohararuna