Skip to main content
[Command] Convert string to JSON
Sophie avatar
Written by Sophie
Updated over a week ago

Definition and Usage

The Convert string to JSON command is used to convert a string variable containing textual JSON data into a JSON object variable that can be easily parsed. It enables easier handling of JSON data in RPA workflows, by converting text to structured JSON objects. Common use cases include:

  • Parsing JSON response strings returned from API calls

  • Reading JSON configuration data from the file system

  • Manipulating and editing JSON test data strings

  • Extracting embedded JSON from scraped web page content

  • Enabling easier processing of JSON data from databases

  • Quickly converting sample JSON snippets into objects for testing

  • Building JSON payloads for API requests from string templates

  • Modifying JSON data stored as string in business databases

  • Converting CSV data into JSON and vice versa for integrations

  • Handling multilevel nested JSON data in string format

  • Cleansing poorly formatted JSON strings into valid objects

  • Importing, and exporting JSON data as strings from Excel and other Office apps


Parameter Values

Set Parameters

Parameter

Description

String to convert

Input a text or select a text variable

Save JSON as

Save JSON as a new variable

Error Handling

Parameter

Definition

When error occurs

Select the action to be performed when an error occurs

  • Terminate the project

  • Ignore the error and execute the next command

  • Retry action


Example

This above workflow converts the json format string {"name":"John", "age":30, "city":"New York"} into a JSON object variable.

Did this answer your question?