- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2023 11:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 09:44 PM - edited 09-07-2023 11:53 PM
I have tried with List Collector in Catalog Client Script to fetch the email ID of users and shows in the text field below
Here is the code (you can change it according to your requirements)
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var traineesNames = g_form.getValue('select_trainee'); // 'select_trainee' is the backend name of the List Collector
var trainees = traineesNames.split(',');
var traineeEmails = [];
for(var i=0;i<trainees.length;i++){
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id',trainees[i]);
gr.query();
while(gr.next()){
traineeEmails.push(gr.email);
}
}
g_form.setValue('trainees_email_id',traineeEmails); // 'trainees_email_id' is the back end name of the text field
}
Please give me correct and helpful, if my answer helps to your requirement.
Thank you
G Ramana Murthy
ServiceNow Developer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 10:40 PM
you didn't share what you tried so far and what's your requirement
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 11:59 AM
This above solution is for global scope. Also, calling server side script from client side not preferred.
Anyone has worked on this in a scoped app environment? I have similar use case as this one mentioned above however, i am looking to see anyone implemented Script Include and catalog client script in scoped app for this solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2024 01:56 AM
Solution has been marked and no further follow up or help is required. Thank you.