How to pass a list value to another list in UI Policy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 10:44 PM
Hi,
Reference the record name of table 1 in table 2's form. I want to use it to query and add the values from the list in table 1 to the list in table 2.
but i can't do this.
Is-he possible to do this ?
Tabale1
name:table1_list_name Type:string
name:table1_list Type:list Reference:sys_user
Table2
name:table1_list_name2 Type:string
name:table2_list Type:list Reference:sys_user
UIPoricy
Conditon
tabale1_list_name2 is not null.
True
function onCondition() {
var userList = new GlideRecord('table1');
var user_array = [];
userList.addQuery('table1_list_name','=',current.table1_list_name2);
userList.query();
user_array.push(userList.table1_list.toSting());
current.table2list = user_array;
}
False
function onCondition() {
var user_array = [];
current.tabele2_list = user_array;
}
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2023 07:00 PM
Entering script include seems to cause errors in function and return.
I have made the following changes, but they do not work properly.
-----script include--------
var getUserDetails = function() {
var id = this.getParameter('sysparm_userID');
var grUser = new GlideRecord('sys_user');
grUser.addQuery('sys_id', id);
grUser.query();
var usrobj = {};
while (grUser.next()) {
usrobj.email = grUser.name.toString();
}
return JSON.stringify(usrobj);
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 07:37 PM
Thank you very much for your answer.
Thank you all.
I found the solution in another post and am attaching it here.