{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":4240,"path":"build-workflows/workflow-studio/json-build-step-action-designer.md","title":"JSON Builder step","bundle":null,"doc_type":null,"release":"australia","body":"\n# JSON Builder step\n\nCreate a JSON payload to use in another step. Enter values or use data pills to produce a dynamic payload. This step supports several data types, including objects and arrays for nested structures.\n\n## Roles and availability\n\nThis step requires an Integration Hub subscription. For more information, see [Legal schedules - Integration Hub overview](https://www.servicenow.com/content/dam/servicenow-assets/public/en-us/doc-type/legal/snc-addendum-integrationhub.pdf). After the required plugin is activated, the step is visible under Integrations.\n\nAvailable as an Workflow Studio action step. Users with the action\\_designer role can create a custom action with one or more action steps.\n\n## Inputs\n\nProvide a value for each input that your action needs. To add dynamic values, you can also drag and drop pills from the Data panel or select them from the pill picker.\n\n-   **Name**\n\n    Data type: **String**\n\n    Name part of a name-value pair. Enter a value or use a data pill to produce a dynamic payload.\n\n-   **Value**\n\n    Data type: **String**\n\n    Value part of a name-value pair. Enter a value or use a data pill to produce a dynamic payload. You can use a complex object pill to populate a row with an object data type, but doing so deletes any children the complex object pill already has.\n\n-   **Type**\n\n    Data type: **Choice**\n\n    Data type for the name-value pair. If you're using a data pill for the name or value, make sure the data type for the pill matches the data type selected here. The options are:\n\n    -   **String**\n    -   **Object**\n    -   **Number**\n    -   **Boolean**\n    -   **Array**\n    For arrays and objects, use the plus icon \\(\\[Omitted image \"plus-icon.png\"\\] Alt text: plus icon\\) to add name-value pairs to the array or object.\n\n-   **In case of empty value**\n\n    Data type: **Choice**\n\n    Option to specify what to do if a name-value pair has an empty or null value.\n\n    -   **Leave as is**: Keeps the empty or null value as an empty string.\n    -   **Omit property**: Excludes a name-value pair if the value is empty or null.\n    -   **Set as null**: Returns an empty or null value as a null data type.\n    -   **Throw error**: Returns an error if a name-value pair has an empty or null value.\n-   **Include Outer Structure**\n\n    Data type: **True/False**\n\n    Option to include the curly braces for a top-level JSON container.\n\n-   **Omit Empty Structure**\n\n    Data type: **True/False**\n\n    Option to omit an empty payload. Empty payloads can occur when you select **Omit property** for the **In case of empty value** input for every name-value pair and all name-value pairs in the payload produce empty values.\n\n-   **Structure**\n\n    Data type: **Structure**\n\n    Read-only payload the step produces.\n\n-   **If this step fails**\n\n    Data type: **Choice**\n\n    Option to continue running the next step or go to error evaluation. To use the step status code or message for a custom action error condition, see [Action error evaluation](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/action-error-evaluation.md).\n\n\n## Outputs\n\nThese outputs appear in the Data panel. You can use them as inputs elsewhere in your action.\n\n-   **Output**\n\n    Data type: **String**\n\n    JSON payload as a string. If you want to use the payload as an object, you can use the [JSON parser step](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/integrate-applications/json-parser-step-action-designer.md) to parse the string.\n\n-   **Step Status**\n\n    Data type: **Object**\n\n    Object data pill containing runtime details about the step. Each step in an action returns a Step Status.\n\n-   **Step Status &gt; Code**\n\n    Data type: **Integer**\n\n    Integer data pill indicating whether the step produced an error. By default, a value of 1 indicates that the step produced an error. A value of 0 indicates that the step ran successfully. You can't customize these codes.\n\n-   **Step Status &gt; Message**\n\n    Data type: **String**\n\n    String data pill containing the error message produced by the step or system operation. You can't customize this message.\n\n\n## Generate a JSON Payload\n\nAutomatically generate a JSON payload with the **Add JSON for Payload** button. This button opens the Add Payload script editor where you can enter a JSON payload to be automatically de-serialized into structured input.\n\nThere are a few details to be aware of when using the JSON payload generator.\n\n-   If the JSON has empty keys, the payload is still generated.\n-   If there are duplicate keys in the script editor, the last key entry in the object overrides the value of any previous keys with the same name.\n-   If the root object is an array, the root array is wrapped into a root object.\n-   If an array contains multiple objects, all the keys in the objects are coalesced into one parent object.\n\nThe JSON payload generator doesn’t support the following.\n\n-   empty payloads\n-   non-complex object types\n-   invalid JSON\n-   empty root objects, such as an empty array\n-   payloads larger than 65,000 bytes\n\n**Note:** Generating a JSON payload overrides any existing structures in the JSON Builder step.\n\n**Parent Topic:**[Workflow Studio steps](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/steps.md)\n\n"}}