How to auto populate a hidden List Collector catalog variable

giuseppefalcone
Tera Contributor

Hi everyone,

 

I want to auto-populate the list collector variable "Asset List" that is a reference to "cmdb_ci_computer" and my reference qualifier is:

javascript: 'assigned_to=' + current.variables.user;

I want to put in this list all asset assigned to selected user in form. But my variable Asset List will be hidden. 

 

giuseppefalcone_0-1716463837162.png

so I whant that the list is auto-filled with this two (or more, based on reference qualifier - asset assigned to selected user in form) values.

I want to see this variable only in RITM and SCTask, for this reason this variable will be hidden in Catalog Item View.

 

Thanks.

1 ACCEPTED SOLUTION

Saloni Suthar
Mega Sage
Mega Sage

Hi @giuseppefalcone,

You need to use client script to auto populate values in the list collector. Please review the post here for the script reference. 


If my response helped you, please click on "Accept as solution" and mark it as helpful.
- Saloni

View solution in original post

2 REPLIES 2

Saloni Suthar
Mega Sage
Mega Sage

Hi @giuseppefalcone,

You need to use client script to auto populate values in the list collector. Please review the post here for the script reference. 


If my response helped you, please click on "Accept as solution" and mark it as helpful.
- Saloni

Abhinav_Ranjan
Tera Contributor

To achieve the auto-population of the hidden "Asset List" variable with assets assigned to the selected user in the form, you can use the following approach:

Create a reference qualifier for the "Asset List" variable using the JavaScript code: javascript: 'assigned_to=' + current.variables.user;

Ensure that the "Asset List" variable is configured to be hidden in the Catalog Item View.

Configure the "Asset List" variable to be visible in Requested Item (RITM) and Service Catalog Task (SCTask) forms.

By following these steps, the "Asset List" variable will be populated with the assets assigned to the selected user in the form, and it will be hidden in the Catalog Item View while being visible in RITM and SCTask forms.