How do I get the user email from a list collector to appear on the RITM?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2023 12:52 PM
I have a catalog item that has a list collector populating the user list. From the service portal the requestor is able to see the users and the emails because I added the variable attributes: ref_auto_completer=AJAXTableCompleter,ref_ac_columns=name;email,ref_ac_columns_search=true,ref_ac_order_by=name
Is there a way I can have the emails appear on the RITM as well?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2023 07:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2023 07:49 AM
Ohh I see when you say RITM where its not visible then thats backend view of servicenow for submitted catalog item.
Well I do not see any possibility of showing email address along with user name on backend when variable is of type list collector, because when it refers to any table in servicenow the display value = true can be done for the table only 1 field and which is 'name' in case of sys_user and thats the reason after selection only name is displayed.
Now if you want then
Option 1. you can have another hidden variable where email address can be added on submission of catalog item and show that variable on RITM.
Option 2. you can think of creating some variable of type custom which consumes UI macro and in that UI macro you have have all related data shown (disclaimer: need knowledge of jelly/scripting)
Option 3. You can also think of having UI action present on RITM like 'Show Email Addresses', and on click of it you can get the value of users selected in variable and show email addresses as alert so that viewer can copy email addresses (if needed).
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2023 10:16 AM
If I did option one, would it need to be a multi line text field? And just have it show on the RITM?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2023 10:47 AM
Yeah sure , multiline variable for having email addresses of selected users.
1. onLoad() client script OR UI policy can be used to hide the variable.
2.onSubmit() client script to set that multiline variable with email addresses of selected users in other variable.
3. same policy (from step 1) you need to make sure not to run for RITM by selecting correct check box.
As a result you will see variable hidden when catalog item is getting submitted and shown when RITM is loaded on backend.
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2023 12:13 PM
Something like this?
function onSubmit() {
//Type appropriate comment here, and begin script below
g_form.getReference('contact_list_emails', function(user) {
g_form.setValue('users_email', user.email);
});
}