How to find which variable set attached to catalog item?

vimal11592
Tera Expert

Hi,

I have create one variable set   --- ABC

One catalog item --- XYZ

I have assigned variable set to catalog item.When I click on "Show xml" of catalog item I am not able to find variable set reference in xml. Can someone please help me with this How to find variable set reference in catalog item xml or how it is attached to catalog item.I have written one script to create catalog item and variable set .I want to know how can I do the mapping between catalog item and variable.

Thanks,

Vimal

1 ACCEPTED SOLUTION

Ankush Agrawal
ServiceNow Employee
ServiceNow Employee

Hi Vimal



The mapping for catalog item to variable set (or variable) are stored in the respective record of the variable set (or variable).


Table for variable set to catalog mapping is 'io_set_item' and table for variables is 'item_option_new'. Below is the example:


1. Mapping of catalog item to variable set:


Each record in the table io_set_item has two columns


  • sc_cat_item: which stores the sys_id of the catalog item
  • variable_set: which stores the sys_id of the variable set

In the record corresponding to expected variable set, you can populate the column sc_cat_item with the sys_id of the desired catalog item.


2. Mapping of catalog item to variable:


Each record in the table item_option_new has a column:


  • cat_item: which stores the sys_id of the catalog item

you can query the variables with the sys_ids and then populate the column cat_item as desired.


View solution in original post

4 REPLIES 4

Inactive_Us1474
Giga Guru

Hi,



Through the related list of the catalog item, variable set gets attached. Show XML would show only the fields of the table not the related list tables.


Check the database schema of the sc_cat_item and item_option_new_set.


Schema Map for Tables - ServiceNow Wiki



Thanks


Aki


Hit Like/Helpful/Correct, if applicable.


Ankush Agrawal
ServiceNow Employee
ServiceNow Employee

Hi Vimal



The mapping for catalog item to variable set (or variable) are stored in the respective record of the variable set (or variable).


Table for variable set to catalog mapping is 'io_set_item' and table for variables is 'item_option_new'. Below is the example:


1. Mapping of catalog item to variable set:


Each record in the table io_set_item has two columns


  • sc_cat_item: which stores the sys_id of the catalog item
  • variable_set: which stores the sys_id of the variable set

In the record corresponding to expected variable set, you can populate the column sc_cat_item with the sys_id of the desired catalog item.


2. Mapping of catalog item to variable:


Each record in the table item_option_new has a column:


  • cat_item: which stores the sys_id of the catalog item

you can query the variables with the sys_ids and then populate the column cat_item as desired.


Thank you for this. I had a similar question: how do I know which items use a specific variable set? In seeing the answer above, all I did was type 'io_set_item.list' in the upper left-hand navigator search bar and then do a "show matching" on the variable set I was wondering about and it resulted in all the items that use that specific variable set. Thanks!


Glad that it helped.