Dynamically populate data in List collector through json response

gsh1
Tera Contributor

Dear all,

We have a requirement where we have to select more than one item in select box in catalog.

Multiselect is only possible through List collector, however the problem is data is dynamically populated through json response.

So question is how can we dynamically populate data in List collector through Json response, is this possible or not?

 

 

1 ACCEPTED SOLUTION

Michael Jones -
Giga Sage

List collectors are a special type of reference field at heart - a reference field holds as its value the sys_id of the table record you selected (and dynamically shows you the display value of that record). A list collector does the same thing, except its value is an array of sys_id's of table records that have been selected. 

So, the answer to your question would depend on whether the values you receive correspond to records in a table. If they do, then you would only need to pass in a comma-separated string of sys_id's to add your selections to the list collector.  

If they do not exist as table records then, unfortunately the answer is no. You would not be able to pass dynamic values into a list collector, have them display on the catalog item, and be able to reference those values later. You would potentially need to develop a UI Macro or Widget to handle that type of advanced field behavior. 

I hope this helps!

If this was helpful, or correct, please be kind and mark the answer appropriately.

Michael Jones - Proud member of the GlideFast Consulting Team!

 

 

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

View solution in original post

6 REPLIES 6

Michael Jones -
Giga Sage

List collectors are a special type of reference field at heart - a reference field holds as its value the sys_id of the table record you selected (and dynamically shows you the display value of that record). A list collector does the same thing, except its value is an array of sys_id's of table records that have been selected. 

So, the answer to your question would depend on whether the values you receive correspond to records in a table. If they do, then you would only need to pass in a comma-separated string of sys_id's to add your selections to the list collector.  

If they do not exist as table records then, unfortunately the answer is no. You would not be able to pass dynamic values into a list collector, have them display on the catalog item, and be able to reference those values later. You would potentially need to develop a UI Macro or Widget to handle that type of advanced field behavior. 

I hope this helps!

If this was helpful, or correct, please be kind and mark the answer appropriately.

Michael Jones - Proud member of the GlideFast Consulting Team!

 

 

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

+++++++++++

So, the answer to your question would depend on whether the values you receive correspond to records in a table. If they do, then you would only need to pass in a comma-separated string of sys_id's to add your selections to the list collector.  

+++++++++++

Yep, Thats the challange, we don't have those records in any table.

Ravi9
ServiceNow Employee
ServiceNow Employee

in that case maybe consider a custom widget ? that way you can collect data , showcase to user and pass it on to fulfiller 

Bhavana Reddy
Mega Guru

Did you get a solution, if so can you please help me here we have the samerequirement