- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2024 09:54 AM
The current problem is: I want to set the list collector value with user list I get back from GlideAjax response in my onChange catalog client script. The `userList` I got back and display on the form is actually the same as my hardcoded list for user sys ids. But when I set the hardcoded value to the users field of the form, it only appears 2 users on the right of the slushbucket. What is going on and how do I resolve this problem?
Below are the code:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2024 11:03 AM
If the property doesn't exist the results are limited to 100. Create a property with that name and set it to 200, or 500, or whatever. Updating the filter, either via reference qualifier or a script will limit the number of records on the left, thereby ensuring that the intended records are present. In this case, it seems like it would be best to use the same string of sys_ids returned by the GlideAjax, then you would precede it with 'sys_idIN' before using it to update the filter, then lastly update the variable value:
function callback(resp) {
var userList = resp;
var varName = list_collector_variable_name;
var filterString = 'sys_idIN' + resp;
try{
var myListCollector = g_list.get(varName);
myListCollector.reset();
myListCollector.setQuery(filterString);
}
//Revert to Service Catalog method
catch(e){
window[varName + 'g_filter'].reset();
window[varName + 'g_filter'].setQuery(filterString);
window[varName + 'acRequest'](null);
}
g_form.setValue('users', userList);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2024 10:10 AM - edited ‎08-29-2024 10:24 AM
I think this issue is that the values must first be in the 'Available' list before they can be 'selected' when doing this via g_form. The system property glide.xmlhttp.excessive limits the results of slushbuckets system-wide, so in this case not every user is initially available to be selected. Increase the value of this property so that more/all records are 'available'.
Depending on the number of records in the list collector table, you might also want/need to update the filter before setting the value, so that all of the intended records to be selected actually are 'available'. See this article for tips on dynamically updating a list collector filter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2024 10:28 AM
Thanks for your reply! But I tried the set the hardcoded value after ga.getXMLAnswer(callback); and then all 4 users will appear. Do you know what specific system property it is for solving it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2024 10:35 AM
I've updated my reply with the property name. I gathered from the original question that only two users appeared whether the value was set by a hard-coded list or a value returned via GlideAjax.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2024 10:48 AM
I checked the sys properties but there is no such property called glide.xmlhttp.excessive. And for updating the filter before setting the value, are you saying on the left side of the list collector, I should probably not display all available users but part of them after filtering?