Auto Populate a list collector field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2022 07:27 AM
I currently have a Service Catalog Item that does the following:
Catalog Item background
Host Name is a reference variable
System Owner is a reference variable
The System Owner auto populates based on the host name.
Workflow
The System Owner needs to approve the request.
This is all working however I have been asked if I can set this up so that multiple host names can be selected which will in turn auto populate the system owner and then send approvals.
I changed both variables to list collector but once the second host name is entered, it clears out the system owner.
Is this possible?
If not list collector, is there another field type or another recommendation for a solution?
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2022 12:57 AM
You should add the values now while adding to the Service Owner field
g_form_setValue('service_owner', oldValue+","+NewAdditonalValue );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2022 01:09 AM
Hi,
check my blog on how to set list collector dynamically onChange of variable
Enhance it as per your requirement
Dynamically set list collector on change of variable
Since you are sending list collector value which is comma separated sysIds update your query to use IN operator
Something like this; It's just an example
recGrp.addQuery('user', 'IN' ,requester);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2022 09:35 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader