Skip to main content

Convert string to JSON object

Sophie avatar
Written by Sophie
Updated over a week ago

Definition and Usage

This command converts a string containing JSON formatted text into a usable JSON object. It allows you to transform JSON text strings into structured JSON objects that can be manipulated and accessed programmatically within your workflow.


Parameter Values

Input parameters

Parameter

Description

Possible Values

Required

Options / Notes

Original text

Enter the text to be converted to JSON object

Any valid JSON string

Yes

The input must be a valid JSON formatted string

Store JSON into

Store the json object in a new variable

Variable name

Yes

The variable will contain the resulting JSON object

Error handling

Parameter Name

Description

Throw error & stop

When an error occurs, the action will trigger an error and stop the execution of the entire app.

Retry command

If an error occurs, the action will retry the command in an attempt to resolve the issue and continue the process.

Ignore error & continue

When an error occurs, the action will be ignored, and the workflow will continue without interruption.

Variables produced

This action produces a variable that contains the JSON object created from the input string. The variable can be used in subsequent steps to access and manipulate the JSON data.


Using Variables in Conditions

You can use variables in the "Original text" field by clicking the {x} icon, which allows you to insert previously defined variables that contain JSON formatted strings. The output variable will be a JSON object that can be used in subsequent actions to access specific properties using dot notation or other JSON manipulation commands.


Notes

  • The input string must be valid JSON format; otherwise, the command will return an error.

  • Common JSON parsing errors include missing quotes around property names, trailing commas, and improperly escaped characters.

  • The resulting JSON object allows for accessing nested properties using dot notation (e.g., jsonObject.property.nestedProperty).

  • This command is particularly useful when working with API responses or data exchange formats that use JSON.

Did this answer your question?