- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 04:57 PM
All kinds of suggestions are welcome.
My requirement is to populate the "Description" field on RITM with the users email attribute, selected on a list collector variable on Catalog Item form.
How can we achieve this?
The user attribute that we want on RITM is only the email address of the user selected from sys_user on list collector on catalog item form.
So basically the end user will pick users in the list collector variable pointing to sys_user, and the email of picked users should show in the "Description" field of RITM.
I know this forum has many Einsteins of ServiceNow to help me out. Thanks. 🙂
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 06:35 PM - edited 01-25-2024 06:36 PM
Hi @Zubair Alam
You can do it in WorkFlow Script, or Flow Designer using inline script or a simple business rules.
Let me explain using BR for example. Create an Before - Insert Business Rule on Requested Items (sc_req_item) table. In the when to run section tab, set the filter condition tab like,
item ::: IS ::: <Your Catalog Item for which you want this functionality>
Then, in the Advanced tab paste the following script inside the business rule function.
var sel_users = current.variables.YOUR_LIST_COLLECTOT_VARIABLE_NAME;
var usrGr = new GlideRecord('sys_user');
usrGr.addEncodedQuery("sys_idIN" + sel_users);
usrGr.query();
var desc = "";
while(usrGr._next()){
desc = desc + "\n" + usrGr.getValue('email');
}
current.description = desc;
Try this an let me know if it didn't work.
Please mark my answer helpful and accept as a solution if it helped 👍✅
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 06:35 PM - edited 01-25-2024 06:36 PM
Hi @Zubair Alam
You can do it in WorkFlow Script, or Flow Designer using inline script or a simple business rules.
Let me explain using BR for example. Create an Before - Insert Business Rule on Requested Items (sc_req_item) table. In the when to run section tab, set the filter condition tab like,
item ::: IS ::: <Your Catalog Item for which you want this functionality>
Then, in the Advanced tab paste the following script inside the business rule function.
var sel_users = current.variables.YOUR_LIST_COLLECTOT_VARIABLE_NAME;
var usrGr = new GlideRecord('sys_user');
usrGr.addEncodedQuery("sys_idIN" + sel_users);
usrGr.query();
var desc = "";
while(usrGr._next()){
desc = desc + "\n" + usrGr.getValue('email');
}
current.description = desc;
Try this an let me know if it didn't work.
Please mark my answer helpful and accept as a solution if it helped 👍✅
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2024 08:15 AM