Get Catalog Variables action

  • Release version: Xanadu
  • Updated August 1, 2024
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Get Catalog Variables action

    TheGet Catalog Variablesaction in ServiceNow's Workflow Studio enables you to retrieve values of catalog variables from requested catalog items and variable sets within a flow. It is designed for users with theflowdesigneroradminroles to incorporate into flows, facilitating dynamic access to catalog variable data at the moment the action runs.

    Show full answer Show less

    Note that this action captures variable values only at runtime. To detect changes in catalog variable values, you must build additional flow logic, such as using the Wait For Condition action with a change operator, and re-invoke this action when values update.

    Inputs

    • Submitted Request: The requested item record from the screqitem table for which you want to retrieve catalog variable values.
    • Template Catalog Items and Variable Sets: The catalog item record used to populate the list of catalog variables (slush bucket). This input requires a specific catalog item record and does not accept dynamic data pills.
    • Catalog Variables: A selectable list of catalog variables from the chosen template catalog items and variable sets whose values you want to extract from the requested item. Selected variables appear as data pills for use elsewhere in the flow. You can also define flow-specific variables for this list.

    Outputs

    The action outputs each selected catalog variable as a separate data pill in the Data panel. The data type of each output matches the catalog variable type, allowing you to utilize these values as inputs in subsequent flow steps. For details on supported variable types, refer to the Service Catalog documentation.

    Practical Example: Retrieving Variables for Hardware Items

    In a typical use case, a flow triggers when a Service Catalog item is requested. The flow:

    • Retrieves the catalog item record of the requested item.
    • Uses conditional logic to check if the item belongs to a specific category (e.g., Hardware).
    • Calls the Get Catalog Variables action, providing the requested item and a template catalog item (such as "Standard Laptop") to specify which variables to retrieve.
    • Extracts all selected catalog variables, which then become available as data pills for further processing.

    This example demonstrates how to dynamically access catalog variable values such as strings and Boolean fields from hardware-related catalog requests, enabling customized flow actions based on catalog data.

    Select variables from multiple template catalog items and variable sets using the Get Catalog Variables action.

    Roles and availability

    Available as a Workflow Studio ServiceNow core action. Users with the flow_designer or admin role can add an action to a flow and define configuration details.
    Note:
    This action only returns the value of catalog variables at the time it was run. If you expect the action to recognize when catalog variable values change, you must build that logic into your flow. For example, use a Wait For Condition action with a changes operator to get catalog variables when a field value changes. If the field value changes, you must add the action in the flow again.

    Inputs

    Provide a value for each input that your flow needs. To add dynamic values, you can also drag and drop pills from the Data panel or select them from the pill picker.

    Submitted Request
    Data type: Record

    The requested item record from the Requested Item [sc_req_item] table for which you want to get catalog variable values.

    Template Catalog Items and Variable Sets [Catalog Items and Variable Sets]
    Data type: Record

    The Catalog Item [sc_cat_item] record you want to use to populate the catalog variables slush bucket. This input does not support any data pill values.

    Catalog Variables
    Data type: Slush Bucket

    The list of catalog variables whose values you want to get from the requested item record. Each catalog variable that you select is displayed as a data pill in the data pane. You can define flow-specific variables that are displayed in the Available list. To define flow-specific variables, see Create flow Service Catalog variables.

    Outputs

    These outputs appear in the Data panel. You can use them as inputs elsewhere in your flow.

    Catalog Variables
    Data type: Varies by catalog variable type

    The data pane displays a separate data pill for each catalog variable selected from the Catalog Variables input. For a list of supported Service Catalog types, see Supported Service Catalog variable types.

    Get catalog variables for hardware items

    Configuration of Get Catalog Variables action

    In this example, a flow runs when someone requests an item from the Service Catalog. The first flow step looks up the Catalog item record of the requested item. The If flow logic uses the category value (Sys ID) of the catalog item to determine if request is for an item in the Hardware category. The Get Catalog Variables action uses the trigger record as the Submitted Request input. The Template Catalog Items and Variable Sets input uses the variables provided in the Standard Laptop catalog item. All three available catalog variables are selected and displayed as data pills in the data pane.

    Execution details of the Get Catalog Variables action

    The flow execution details show that the Submitted Request links to a request for a standard laptop. Of the three catalog variables, the string variable is empty and the two Boolean variables are false.