How to assign values to list collector field in a catalog item?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2023 09:45 AM
I have a list collector referencing sys_user table and need to assign some values to it.
How do I do that using catalog client script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2023 11:48 AM
A List Collector stores a comma-separated list of sys_ids for the table that it references, so if you want to hard-code the values then it would look like this:
g_form.setValue('variable_name', '1,2,3,4');
Where 1, 2, 3, and 4 are all replaced with an actual sys_id on the user table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2023 04:33 AM
Hi @Brad Bowman ,
I have written the catalog client script for this and it is working in portal but its not working in normal Platform view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2023 07:26 AM
If you can add the glide_list attribute to the variable so that it in the native UI it appears similar to the Portal view, then the same script should work. If you need to see the Available and Selected boxes the script is a lot more involved as you would have to reset the filter to include the value(s) that you want to set, then move each value from the Available to Selected box, then probably reset the filter again so that the requestor could add more values - if you want them to do this. It's possible, just a lot more involved, so let me know if glide_list doesn't work for you and I can try to come up with the other script.