Use PDIs? Take our 5-minute survey to help shape the PDI roadmap.

variable options bulk import

shivanib56
Tera Contributor

I am trying to create a catalog item record in which there are nearly 400 + Variable options needs to be created. 

Is there a way I can do a bulk import of this data rather than creating each variable option manually.

If yes,what is it?

1 ACCEPTED SOLUTION

Tejas Adhalrao
Kilo Sage

hi @shivanib56  ,

The easiest approach is to use Import Sets to import the records into the Question Choice.

question_choice.list

TejasAdhalrao_0-1785944514066.png

  • Create your choices in an Excel file (value, label, sequence, language if applicable, and the associated variable). (You can click on the list header > click on import > select the insert option, and download the Excel template to import data)
  • Import the file using System Import Sets.
  • Map the data to the Question Choice (question_choice) table using a Transform Map.

If this is a one-time activity and you're comfortable with scripting, you could also use a background script to insert the records. However, I'd recommend the Import Set approach since it's easier to validate and rerun if needed.

 

If this helped, please mark it as Helpful. If it resolved your issue, please mark it as the Accepted Solution.

View solution in original post

3 REPLIES 3

Lakshmi888888
Kilo Guru

Yes, you can bulk load variable options using Import Sets and Transform Maps.

The variable choices are stored in the Question Choice [question_choice] table. Create an Excel/CSV file containing the choice values (for example: Question, Value, Label, Order), load it using System Import Sets → Load Data, and transform the data into the question_choice table.

Typical columns include:

  • Question (Variable Sys ID)
  • Value
  • Text/Label
  • Order

If all 400+ options belong to the same Select Box or Multiple Choice variable, you can export the variable's sys_id once and populate it for every record in the import file.

Alternatively, if the list is generated from another table, consider using a Lookup Select Box instead of maintaining hundreds of static choices.

For one-time loads, many developers also use a background script to insert records into the question_choice table programmatically.

For 400+ options, Import Sets are usually the fastest and most maintainable approach.

Additional recommendation: If the choices are likely to change over time, create a custom table and use a Lookup Select Box or Reference variable rather than maintaining hundreds of static variable choices. This reduces future maintenance significantly.


Please mark this response as Helpful or Correct if it helped.

Abhishek Pal
Giga Guru

Hi @shivanib56 ,

Yes, you can bulk-load the options, but with more than 400 values, first consider whether a Select Box is the right design.

Recommended approach:

Use a Reference variable backed by a table if the values are business data that may change over time.

1. Create or reuse a table containing fields such as:

- Name
- Code or value
- Active
- Order
- Category, if filtering is required

2. Import the 400 records into that table using an Import Set and Transform Map.

3. Configure the catalog variable as:

Type: Reference
Reference table: Your values table
Reference qualifier: active=true

A Reference variable provides type-ahead search and is generally easier for users than scrolling through 400 choices.

You may also use a Lookup Select Box, but ServiceNow recommends using a Reference variable when the source table contains a large number of records.

If the options are genuinely static and must remain Question Choices, import them into:

Question Choice [question_choice]

Recommended import process:

1. Prepare an Excel file with these columns:

question_sys_id
text
value
order
inactive

Example:

question_sys_id: Sys ID of the catalog variable
text: Option displayed to the user
value: Value stored with the request
order: 100, 200, 300, etc.
inactive: false

2. Navigate to:

System Import Sets > Load Data

3. Upload the Excel file and create a staging table.

4. Create a Transform Map targeting:

Question Choice [question_choice]

5. Map the fields as follows:

question_sys_id -> Question
text -> Text
value -> Value
order -> Order
inactive -> Inactive

6. Configure both Question and Value as coalesce fields if you need to update existing options without creating duplicates.

7. Test the import in a sub-production instance before moving it to production.

Use the variable sys_id in the Question column rather than the variable name because variable names may not be unique.

Important considerations:

- Do not import these records into Choice [sys_choice]. Catalog variable choices are stored in Question Choice [question_choice].
- Avoid Business Rules or scripts that insert hundreds of choices every time the catalog item loads.
- Do not delete choices already used by submitted requests unless the historical impact has been reviewed. Mark obsolete choices inactive instead.
- Test the catalog item in Service Portal, Employee Center, and Workspace where applicable.
- If these values require frequent updates, reporting, ownership, filtering, or integration, use a Reference variable instead of maintaining 400 static Question Choice records.

Therefore:

Dynamic or reusable business values
-> Reference variable backed by a table

Static values that must be stored as catalog choices
-> Import Set and Transform Map to question_choice

Official references:

Question Choices:
https://www.servicenow.com/docs/r/servicenow-platform/service-catalog/define-question-choice-var.htm...

Reference variable:
https://www.servicenow.com/docs/r/servicenow-platform/service-catalog/reference.html

Lookup Select Box:
https://www.servicenow.com/docs/r/servicenow-platform/service-catalog/lookup-select-box.html

Hope this helps!

If this response helped, please mark it as Helpful.
If it resolves your issue, please Accept it as Solution.

Kind Regards,
Abhishek Pal

Tejas Adhalrao
Kilo Sage

hi @shivanib56  ,

The easiest approach is to use Import Sets to import the records into the Question Choice.

question_choice.list

TejasAdhalrao_0-1785944514066.png

  • Create your choices in an Excel file (value, label, sequence, language if applicable, and the associated variable). (You can click on the list header > click on import > select the insert option, and download the Excel template to import data)
  • Import the file using System Import Sets.
  • Map the data to the Question Choice (question_choice) table using a Transform Map.

If this is a one-time activity and you're comfortable with scripting, you could also use a background script to insert the records. However, I'd recommend the Import Set approach since it's easier to validate and rerun if needed.

 

If this helped, please mark it as Helpful. If it resolved your issue, please mark it as the Accepted Solution.