{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":49005,"path":"servicenow-platform/service-catalog/t_CreateAVariableSet.md","title":"Create a variable set and add it to an item","bundle":null,"doc_type":null,"release":"australia","body":"\n# Create a variable set and add it to an item\n\nCreate a set of variables and add them to multiple catalog items and order guides for reuse.\n\n## Before you begin\n\nRole required: catalog\\_admin, admin, catalog\\_editor, or catalog\\_manager\n\n## About this task\n\n-   Variable sets within a catalog item cannot have the same internal name.\n-   Within a catalog item, the name of a variable cannot be the same as the title or internal name of a variable set.\n-   Any catalog client script or catalog UI policy script should refer to the internal name of a variable set instead of its name or title.\n\n## Procedure\n\n1.  Navigate to **All** &gt; **Service Catalog** &gt; **Catalog Variables** &gt; **Variable Sets**.\n\n2.  Click **New**.\n\n    The Variable Set Creation page is displayed.\n\n3.  Select any of the following.\n\n    |Option|Description|\n    |------|-----------|\n    |**Single-Row Variable Set**|Creates a variable set with variables that are grouped together. **Type** field is set to `Single Row`.|\n    |**Multi-Row Variable Set**|Creates a variable set with multiple rows that captures variable data in a grid layout. **Type** field is set to `Multi Row`.|\n\n4.  Enter details.\n\n<table id=\"table_c2q_s1c_xq\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nTitle\n\n</td><td>\n\nTitle of a variable set. Appears if the **Display title** check box is selected.\n\n</td></tr><tr><td>\n\nInternal name\n\n</td><td>\n\nVariable set name for internal use. For example, to access the variable set for the front-end \\(through the g\\_form API\\) and server side scripting.\n\n</td></tr><tr><td>\n\nOrder\n\n</td><td>\n\nOrder number for the variable set.\n\n</td></tr><tr><td>\n\nType\n\n</td><td>\n\nType of the variable set. Possible choices are:-   Single Row\n-   Multi Row\n\n\n</td></tr><tr><td>\n\nApplication\n\n</td><td>\n\nApplications that can use this variable set.\n\n</td></tr><tr><td>\n\nDisplay title\n\n</td><td>\n\nIf selected, adds a title and an expandable header to the right of the variable set.**Note:** When a user requests the item, all check box variables are grouped under a default title of **Options**. To use a custom title, insert a variable of type **Label**, with an **Order** value that puts it directly above the check box variables.\n\n</td></tr><tr><td>\n\nVariable Set attributes\n\n</td><td>\n\nAttributes for configuring a multi-row variable set. Use the **max\\_rows** attribute to set a limit to the number of rows that you can add to a multi-row variable set. For example, specify `max_rows=1` as the field value.\n\n</td></tr><tr><td>\n\nLayout\n\n</td><td>\n\nThe layout display. Set to **1 Column Wide** or **2 Columns Wide, alternating sides** or **2 Columns Wide, one side, then the other**.\n\n</td></tr><tr><td>\n\nDescription\n\n</td><td>\n\nDescription of the variable set.\n\n</td></tr></tbody>\n</table>5.  Right-click and select **Save**.\n\n6.  Create the variables to use in that set.\n\n    1.  In the Variables related list, click **New**.\n\n    2.  Follow the steps for [creating variables](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/service-catalog/t_CreateAVariableForACatalogItem.md).\n\n        **Note:** For a multi-row variable set:\n\n        -   The included variables are displayed as columns of a table.\n        -   The column order is the order of variables defined in the variable set.\n7.  To create an associated catalog data lookup rule, perform the following steps.\n\n    1.  In the Catalog Data Lookup Definitions related list, click **New**.\n\n    2.  On the Catalog Data Lookup Definitions form, fill the fields.\n\n        For information on creating a data lookup rule, see [Create a catalog lookup definition](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/service-catalog/t_CreatACatDataLookupDefRec.md).\n\n8.  Click **Submit**.\n\n\n**Parent Topic:**[Service catalog variable sets](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/service-catalog/c_ServiceCatalogVariableSets.md)\n\n## Add a variable set to a catalog item or order guide\n\nService Catalog enables you to add a variable set to one or more catalog items or order guides.\n\n### Before you begin\n\nRole required: catalog\\_admin, admin, catalog\\_editor, or catalog\\_manager\n\n### Procedure\n\n1.  Open a catalog item or an order guide.\n\n    |Option|Navigation path|\n    |------|---------------|\n    |**Catalog item**|**Service Catalog** &gt; **Catalog Definition** &gt; **Maintain Items**|\n    |**Order guide**|**Service Catalog** &gt; **Catalog Definition** &gt; **Order Guides**|\n\n2.  In the **Variable Sets** related list, click **Edit**.\n\n    You can configure the form to add the **Variable Sets** related list.\n\n3.  Select and add a variable set.\n\n    **Note:** If the **Cascade Variables** check box is selected for an order guide, multi-row variable set data should be cascaded to the included items.\n\n4.  Click **Save**.\n\n5.  Click **Try**.\n\n    **Note:** For a multi-row variable set:\n\n    -   The associated variables are displayed as columns of a table on a catalog item or record producer. Each row corresponds to a set of data for all variables in the variable set.\n    -   The column order is the order of variables defined in the variable set.\n6.  Edit a multi-row variable set.\n\n    1.  To add a row, click **Add** within the variable set, specify the variable information in the **Add Row** window, and click **Add**.\n\n        **Note:**\n\n        -   A maximum of 50 rows can be added.\n        -   Unless default values are provided for variables or On Load scripts are used to pre-populate data, you should add variable data for each row.\n    2.  To edit a row, click the edit row icon \\[Omitted image \"EditRow.png\"\\] Alt text: Icon to edit a row in the **Actions** column, specify the variable information in the Edit Row window, and click **Save**.\n\n        **Note:** When you add or edit an existing row, all catalog UI policies and client scripts associated with the multi-row variable set should be honored.\n\n    3.  To remove a row, click the remove row icon \\[Omitted image \"RemvRow.png\"\\] Alt text: Icon to remove a rowin the **Actions** column and click **Remove** in the confirmation window.\n\n    4.  To remove all rows of the table, Click **Remove All** within the variable set and click **Remove** in the confirmation window.\n\n\n"}}