{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":4043,"path":"build-workflows/workflow-studio/create-data-definition.md","title":"Create a Data Definition","bundle":null,"doc_type":null,"release":"australia","body":"\n# Create a Data Definition\n\nUse data definitions to collect and use pieces of information later in a playbook.\n\n## Before you begin\n\n**Important:** As of the 26.1 release, the **Collect user data** activity is no longer available in the activity picker. The activity will continue to function wherever it is used, but for new activities use the **Questionnaire** activity instead. The **Questionnaire** activity does not require you to create a data definition. To learn more about the **Questionnaire** activity, see [Questionnaire activity](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/questionnaire-activity.md).\n\nRole required: admin, flow\\_designer\n\nYou will be working in the ServiceNow AI Platform to complete this task.\n\n## About this task\n\nA data definition is the information that you want an agent or fulfiller to collect during a playbook run, and is the key input of the **Collect user data** activity. Playbook authors define the data they want an agent or fulfiller to collect in the `sys_flow_data_definition` table. When an agent or fulfiller collects the information, the information is stored in the `sys_flow_data` table for use later during the playbook run, instead of in the record table.\n\nOnly use a data definition if:\n\n-   The data is only needed downstream during a single playbook run. It's collected, used, and never needed again.\n-   You don't need to run any reports on the collected data. If you need any metrics or reports on the collected data, create a table and use the [User Form activity](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/user-form-activity.md) instead.\n\nFor example, you may have multiple teams that perform activities. One team enters the inputs for a created data definition when they perform a **Collect user data** activity, and then a second team uses the collected inputs to complete the playbook, and the information is not needed afterwards.\n\n## Procedure\n\n1.  Navigate to **All** &gt; **Process Automation** &gt; **Process Automation Administration** &gt; **Data Definitions**.\n\n2.  Select **New** to create a new data definition.\n\n3.  Give your new data definition a name.\n\n    **Note:** Data definitions have the same scope as other metadata tables, by default.\n\n4.  Right-click in the record header to **Save**.\n\n    If you select the **Submit** button, you are taken back to the **Data Definitions** list and will need to select your new data definition to re-open it.\n\n5.  Add fields for information that you want an agent to collect.\n\n    1.  In the **Flow Data Variables** table, select **New**.\n\n    2.  Enter the required fields.\n\n<table id=\"choicetable_qcs_vmh_j1c\"><tbody><tr><td id=\"d66356e229\">\n\n**Type**\n\n</td><td>\n\nThe type of input the agent is collecting for a field. For example, string, reference, integer, etc.\n\n</td></tr><tr><td id=\"d66356e238\">\n\n**Label**\n\n</td><td>\n\nThe label of the field in the UI, during the playbook run. The label can consist of any text.\n\n</td></tr><tr><td id=\"d66356e250\">\n\n**Column name**\n\n</td><td>\n\nThe name of the input being collected. Spaces cannot be used to delimit words.\n\n</td></tr><tr><td id=\"d66356e259\">\n\n**Max Length**\n\n</td><td>\n\nThe maximum length a string value can be entered for a string type of field. The variable can store longer strings than it can display.\n\n</td></tr><tr><td id=\"d66356e268\">\n\n**Application**\n\n</td><td>\n\nThe application scope for the data variable. It is always set to Global, and cannot be changed.\n\n</td></tr></tbody>\n</table>6.  Optional configurations\n7.  Under the **Default Value** tab, specify the value used when a playbook does not provide a value.\n\n8.  Right-click in the record header to **Save**.\n\n9.  Under the **Choice List Specification** tab, use the **Choice** field to present options as a choice list to agents, or to add choices to a field of List type.\n\n    This tab only appears when you select an applicable **Type**.\n\n    **Note:** In **Advanced view**, an additional **Choice table** field displays.\n\n10. Advanced view\n11. Select **Advanced view** under **Related Links** to configure more fields.\n\n\n## Result\n\nThe data definition can now be used when configuring activities in Playbooks in Workflow Studio.\n\n## Example\n\nDuring a playbook run, you can use data definitions to potentially:\n\n-   Collect a shipping address, then reference the address when generating a shipping label.\n-   Ask the user \"yes\" or \"no\" questions, and determine subsequent activities based on the user's responses.\n\n## What to do next\n\nPer Yaron/Bim, add a topic on defining a form view for your data definition and link down here. Jay Wang is creating draft in sharepoint.\n\nConfigure a [**Collect user data** activity](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/collect-user-data-activity.md) in Workflow Studio Playbooks to use your new data definition.\n\n**Parent Topic:**[Administering Playbooks](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/administering-process-automation-designer.md)\n\n"}}