Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

create catalog item from catalog item

LKSN
Tera Contributor

We have users that use Catalog Builder. Then we have users that want catalog items and don't want to use CB, even though their request is pretty simple. A couple variables, simple step based fulfillment. For that, I was thinking we could create a catalog item that creates a catalog item. 

 

I'm using flow designer and am able to have it create the catalog item. But I'm having issues creating the variables. On the catalog item request form, I have three variables:
Field #1 - Type = the various types of variables
Field #2 - Type = the various types of variables
Field #3 - Type = the various types of variables

I create a record tied to the catalog item record on sc_cat_item_option table, with the variables collected from the form. If I test it, it creates the record, but doesn't associate it to the catalog item. 

What table should I reference and how should I tie the two together? 
This is part of the flow

LKSN_0-1759594260141.png

Thank you for any help. 




1 ACCEPTED SOLUTION

NavinAgarwal
Kilo Guru

 

Hi @LKSN ,

 

To link created variables to a catalog item in Flow Designer, you should create records in the sc_item_option_new table (which defines catalog variables) and relate them to the catalog item in the sc_item_option_new table's catalog_item field. You will use the Catalog Item Table (sc_catalog_item) for the catalog item itself, and the Item Option New Table (sc_item_option_new) for the variables, linking them by referencing the catalog item's sys_id in the sc_item_option_new catalog_item field.

 

1. Get the Catalog Item's sys_id:
When your flow creates the new catalog item in the sc_catalog_item table, make sure to capture its sys_id. You'll need this to link the variables.


2. Create the Variable in sc_item_option_new:

 

  • Table: sc_item_option_new
  • Record Creation: Use the "Create Record" action in Flow Designer to create a new record on this table.
  • Fields to populate:
    question: The name of your variable (e.g., "Field #1").
    type: The type of variable you want (e.g., string, boolean, reference).
    catalog_item: This is the key field. Set this to the sys_id of the catalog item you created in step 1.
    sys_name: A unique internal name for the variable (e.g., field_1).
    label: This is also the name of the variable (e.g., "Field #1").
    read_only: Set to false for editable fields.
    mandatory: Set to false to make the field optional.
    default_value: Set a default value if needed.

3. Repeat for Each Variable

 

  • Repeat the "Create Record" action for "Field #2" and "Field #3", making sure to set the catalog_item field to the correct sys_id in each case.

Why this approach is correct:

  1. The sc_cat_item_option table is for actual requested item option choices for a specific request, not for the definition of variables on a catalog item.
  2. The sc_item_option_new table is the correct place to define the variables for a catalog item.
  3. By setting the catalog_item field to the sys_id of your newly created catalog item, you properly associate the variables with that item.

If you found my response helpful, could you please mark it as ‘Accept as Solution’ and ‘Helpful’? This small action goes a long way in helping other community members find the right answers more easily and supports the community.

View solution in original post

3 REPLIES 3

vignesh parthib
Tera Guru

Hi @LKSN 

 

 

unlikely this is not highly recommended, Automating creation of catalog items could unintentionally allow lower-privileged users to create service catalog items without oversight. This bypasses normal role-based access, approvals, and testing processes.

 

Flow Designer doesn’t natively support writing/create on certain table due to restriction. If you try to modify the script it will affect your future upgrade.

 

Thanks,
Vignesh
"If this solution resolves your issue, kindly mark it as correct."

 

 

 

NavinAgarwal
Kilo Guru

 

Hi @LKSN ,

 

To link created variables to a catalog item in Flow Designer, you should create records in the sc_item_option_new table (which defines catalog variables) and relate them to the catalog item in the sc_item_option_new table's catalog_item field. You will use the Catalog Item Table (sc_catalog_item) for the catalog item itself, and the Item Option New Table (sc_item_option_new) for the variables, linking them by referencing the catalog item's sys_id in the sc_item_option_new catalog_item field.

 

1. Get the Catalog Item's sys_id:
When your flow creates the new catalog item in the sc_catalog_item table, make sure to capture its sys_id. You'll need this to link the variables.


2. Create the Variable in sc_item_option_new:

 

  • Table: sc_item_option_new
  • Record Creation: Use the "Create Record" action in Flow Designer to create a new record on this table.
  • Fields to populate:
    question: The name of your variable (e.g., "Field #1").
    type: The type of variable you want (e.g., string, boolean, reference).
    catalog_item: This is the key field. Set this to the sys_id of the catalog item you created in step 1.
    sys_name: A unique internal name for the variable (e.g., field_1).
    label: This is also the name of the variable (e.g., "Field #1").
    read_only: Set to false for editable fields.
    mandatory: Set to false to make the field optional.
    default_value: Set a default value if needed.

3. Repeat for Each Variable

 

  • Repeat the "Create Record" action for "Field #2" and "Field #3", making sure to set the catalog_item field to the correct sys_id in each case.

Why this approach is correct:

  1. The sc_cat_item_option table is for actual requested item option choices for a specific request, not for the definition of variables on a catalog item.
  2. The sc_item_option_new table is the correct place to define the variables for a catalog item.
  3. By setting the catalog_item field to the sys_id of your newly created catalog item, you properly associate the variables with that item.

If you found my response helpful, could you please mark it as ‘Accept as Solution’ and ‘Helpful’? This small action goes a long way in helping other community members find the right answers more easily and supports the community.

kaushal_snow
Giga Sage

@LKSN ,

 

To create a catalog item from another catalog item in ServiceNow using Flow Designer, you should focus on the sc_item_option_new table, which defines catalog variables. When your flow creates a new catalog item in the sc_cat_item table, capture its sys_id. Then, for each variable you want to associate, create a record in the sc_item_option_new table, setting the catalog_item field to the captured sys_id of the newly created catalog item.....

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/