- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2023 08:14 AM
Hello I am having an issue on my catalog item where when the data in the list collector shows on the catalog item in the portal view,
but when I submit the record the ritm shows the value as blank.
I did notice when I try the item in the native view the list collector doesnt populate. I have a client script and a script include that are suppose to populate the list collector with the groups the user in the reference field is in but for some reason it isnt saving and im not seeing why. below is the scripts:
Client script is on change of the user field:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var gajax = new GlideAjax('GroupsMembership');
gajax.addParam('sysparm_name','getGroups');
gajax.addParam('sysparm_userID', newValue);
gajax.getXML(getResults);
}
function getResults(response){
var answer = response.responseXML.documentElement.getAttribute("answer");
g_form.setValue('remove_group', answer);
}
Here is the script include:
var GroupsMembership = Class.create();
GroupsMembership.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getGroups: function() {
var groups = [];
var user = this.getParameter('sysparm_userID');
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('user', user);
gr.addEncodedQuery('group.parent=148b7f921ba874100888ed7bbc4bcbba');
gr.query();
while (gr.next()) {
groups.push(gr.group.getDisplayValue());
}
return groups.toString();
},
type: 'GroupsMembership'
});
Any assistance would be greatly appreciated
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2023 01:21 PM
I was able to solve this issue. In the script include
groups.push(gr.group.getDisplayValue());
was causing the problem. I changed it to
groups.push(gr.group.getValue());
and it works fine now.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2023 09:18 AM
Do you have any UI policies that are clearing the variables for RITM's/SC Tasks?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2023 09:54 AM
No, hiding but not clearing

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2023 09:57 AM
Based on the screenshot you posted, it's not hidden either
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2023 09:58 AM
Its hidden if you were to "select an option" different than the remove