{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":49367,"path":"servicenow-platform/t_CreateAStateFlow.md","title":"Create a state flow","bundle":null,"doc_type":null,"release":"australia","body":"\n# Create a state flow\n\nCreating State Flows.\n\n## Before you begin\n\nRole required: none\n\n## Procedure\n\n1.  Navigate to **All** &gt; **State Flows** &gt; **State Flows** and click **New**.\n\n2.  Fill in the fields, as appropriate.\n\n    The system enforces the field controls with the same client script that filters the choice list for the State field.\n\n<table id=\"table_qfl_nwk_cp\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nNumber\n\n</td><td>\n\nAutomatically generated record number\n\n</td></tr><tr><td>\n\nTable\n\n</td><td>\n\n\\[Required\\] Table on which the state flow record runs. Only tables that extend the Task `[task]` table are available in the list.\n\n</td></tr><tr><td>\n\nStarting state\n\n</td><td>\n\nName of the state at the beginning of the transition. The selections in this field are filtered by the possible states for the table selected.\n\n</td></tr><tr><td>\n\nEnding state\n\n</td><td>\n\nName of the state at the end of the transition. The selections in this field are filtered by the possible states for the table selected.\n\n</td></tr><tr><td>\n\nClient script\n\n</td><td>\n\nClient script to run for this transition. The client script controls the available states you can select by limiting the contents of the State choice list to valid states. This client script also controls specific field behavior configured for state changes in the Field Controls section of the form.\n\n</td></tr><tr><td>\n\nEvent\n\n</td><td>\n\nName of an existing event to trigger when this transition occurs. See [evernts triggered on state changes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/c_StateFlows.md) for more information.\n\n</td></tr><tr><td>\n\nName\n\n</td><td>\n\nName of this record. Make sure the name is descriptive of the state transition or the processing that the record is performing. This name does not have to be unique.\n\n</td></tr><tr><td>\n\nRoles\n\n</td><td>\n\nNot used for any processing.\n\n</td></tr><tr><td>\n\nActive\n\n</td><td>\n\nEnables or disables this state flow record.\n\n</td></tr><tr><td>\n\nClass\n\n</td><td>\n\nDefines the state flow class for this record. The system selects the appropriate class from these options:-   State Flow: Records created for state flows in all task-based tables except those in work management.\n-   Work Order Flow: Records created for state flows in the Work Order `[wm_order]` table. This class is available when work management is activated.\n-   Work Task Flow: Records created for state flows in the Work Order Task `[wm_task]` table. This class is available when work management is activated.\n\n\n</td></tr><tr><td>\n\nDictionary override\n\n</td><td>\n\nSets the starting value for the State field on all new records for the table named in the state flow record. See [dictionary overrides](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/c_StateFlows.md) for configuration procedures.\n\n</td></tr><tr><td>\n\nWork notes\n\n</td><td>\n\nNoteworthy comments about this state flow transition. For details about how these notes are used, see [Work Notes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/c_WorkNotes.md).\n\n</td></tr><tr><td>\n\nComment\n\n</td><td>\n\nDetails about the customized record.\n\n</td></tr><tr><td colspan=\"2\">\n\nManual \\(Runs scripts from a UI action that require the user to click a button or related link.\\)\n\n</td></tr><tr><td>\n\nManual condition string\n\n</td><td>\n\nConditions for enabling a UI action that cannot be defined with the condition builder. For example, you can use this string to define UI actions for mobile devices. This condition has an \\[and\\] relationship with the condition in the Manual condition field.\n\n</td></tr><tr><td>\n\nManual condition\n\n</td><td>\n\nConditions for enabling a UI action that can be defined for fields in the target table. This condition has an \\[and\\] relationship with the condition in the Manual condition string field.\n\n</td></tr><tr><td>\n\nManual script\n\n</td><td>\n\nScript that defines what the UI action does when the conditions are true. This script runs when the user clicks a button or a related link.\n\n</td></tr><tr><td>\n\nUI action\n\n</td><td>\n\n\\[Read Only\\] Name of the button that the system creates to enable this transition. The system creates the label using the same name as the state flow record that created it.\n\n</td></tr><tr><td colspan=\"2\">\n\nAutomatic \\(Runs a business rule automatically when a task record is changed and updated.\\)\n\n</td></tr><tr><td>\n\nAutomatic condition string\n\n</td><td>\n\nConditions for running the business rule that cannot be defined with the condition builder, such as evaluating if the proposed transition is a valid flow. This condition has an \\[and\\] relationship with the condition in the Automatic condition field.\n\n</td></tr><tr><td>\n\nAutomatic condition\n\n</td><td>\n\nConditions for running the business rule that can be defined for fields in the target table. This condition has an \\[and\\] relationship with the condition in the Automatic condition string field.\n\n</td></tr><tr><td>\n\nAutomatic script\n\n</td><td>\n\nScript that performs additional work when the condition is true. This script can do tasks such as update the date and time the transition occurred or notify someone using email when a specific state change occurs. Automatic state transitions occur when changes are made to the task record.\n\n</td></tr><tr><td>\n\nBusiness rule\n\n</td><td>\n\nName of the business rule created for this transition. Two conditions must be satisfied before this business rule can run. The task must be on a specific starting state, and the Automatic condition must be true. If both of these conditions are satisfied, the business rule performs the transition requested, using the starting and ending states from the State Flow form.\n\n</td></tr><tr><td colspan=\"2\">\n\nField Controls \\(Determines [field properties](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/c_StateFlows.md) when a record transitions between states or reaches a specific end state.\\)\n\n</td></tr><tr><td>\n\nMandatory fields\n\n</td><td>\n\nMakes the selected fields required when this transition occurs, or when the end state is the current state.\n\n</td></tr><tr><td>\n\nRead only fields\n\n</td><td>\n\nPrevents the selected fields from being edited when this transition occurs, or when the end state is the current state.\n\n</td></tr><tr><td>\n\nVisible fields\n\n</td><td>\n\nDisplays the selected fields when this transition occurs, or when the end state is the current state.\n\n</td></tr><tr><td>\n\nNot mandatory\n\n</td><td>\n\nMakes the selected fields optional when this transition occurs, or when the end state is the current state.\n\n</td></tr><tr><td>\n\nNot read only\n\n</td><td>\n\nMakes the selected fields editable when this transition occurs, or when the end state is the current state.\n\n</td></tr><tr><td>\n\nNot visible\n\n</td><td>\n\nHides the selected fields when this transition occurs, or when the end state is the current state.\n\n</td></tr></tbody>\n</table>3.  Determine if you want the state transition method to be manual or automatic and open the appropriate section on the form.\n\n    -   Manual: Click **Create UI Action** to create a button on the task form that enables users to execute the transition manually. The system uses the value in the Name field as the label for the UI action. The UI action executes the script in the Manual Script field when the conditions are true. For example, a manual transition can create an **Activate** button when an incident is in the New state that enables a user to mark the incident as active.\n    -   Automatic: Click **Create Business Rule** to create the business rule. The business rule executes the script in the Automatic Script field when the conditions are true. For example, a business rule created by the system can set an incident state to Assigned when theAssigned to field is populated. Business rules are automatically deleted when the state flow record is deleted. For more information, see [Business rules](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/c_BusinessRules.md).\n4.  Click **Create Client Script** to create the script that limits the values offered in a task record's State field to valid states for that transition.\n\n5.  Configure the fields in the Field Controls section to control how specific fields display when a task record changes states.\n\n\n**Parent Topic:**[Use state flows](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/c_UseStateFlows.md)\n\n**Related topics**  \n\n\n[Use state flows](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/c_UseStateFlows.md)\n\n"}}