Change Data Format Component

Change data from one format to another
Component key: change-data-format#
DescriptionThe change data format component allows you to convert data between common formats, like JSON, XML, CSV, and YAML, and to serialize (turn an object into a string) or deserialize (turn a string into an object) each supported format.
For example, the "JSON to XML" action will convert a JSON string that looks like this:
{ "user": { "name": "John Doe", "dob": "19880101", "phones": ["555-123-4567", "555-555-5555"] }}
into an XML string that looks like this:
<user> <name>John Doe</name> <dob>19880101</dob> <phones>555-123-4567</phones> <phones>555-555-5555</phones></user>
A "Deserialize XML" action, when run on the above XML, would convert the XML into an object whose keys can be referenced in subsequent steps.

#
Actions#
Convert To BooleanConvert a value to a number | key: convertToBoolean
Input | Notes |
---|---|
Input The value to be converted to a boolean string / Required value | Notes |
#
Convert To IntegerConvert a value to an int | key: convertToInt
Input | Notes |
---|---|
Input The value to be converted to a integer string / Required value | Notes |
#
Convert To NumberConvert a value to a number | key: convertToNumber
Input | Notes |
---|---|
Input The value to be converted to a number string / Required value | Notes |
#
Convert To StringConvert a value to a string | key: convertToString
Input | Notes |
---|---|
Input The value to be converted to a string string / Required value | Notes |
#
CSV to JSONConvert CSV to JSON | key: csvToJson
Input | Default | Notes | Example |
---|---|---|---|
Input Data code / Required data | Default | Notes CSV data to convert to JSON | Example
|
Input CSV Header boolean isHeader | Default true | Notes Specify if your CSV contains a header row. | Example |
#
Output Example Payload{ "data": "{\n \"person\": {\n \"first\": \"Bob\",\n \"last\": \"Johnson\"\n },\n \"dob\": \"1990-01-01\"\n}", "contentType": "application/json"}
#
CSV to XMLConvert CSV to XML | key: csvToXml
Input | Default | Notes | Example |
---|---|---|---|
Input Data code / Required data | Default | Notes CSV data to convert to XML | Example
|
Input CSV Header boolean isHeader | Default true | Notes Specify if your CSV contains a header row. | Example |
#
Output Example Payload{ "data": "<dob>1990-01-01</dob>\n<person>\n <first>Bob</first>\n <last>Johnson</last>\n</person>", "contentType": "text/xml"}
#
CSV to YAMLConvert CSV to YAML | key: csvToYaml
Input | Default | Notes | Example |
---|---|---|---|
Input Data code / Required data | Default | Notes CSV data to convert to YAML | Example
|
Input CSV Header boolean isHeader | Default true | Notes Specify if your CSV contains a header row. | Example |
#
Output Example Payload{ "data": "---\nperson:\n first: Bob\n last: Johnson\ndob: '1990-01-01'", "contentType": "text/yaml"}
#
Deserialize BINARYDeserialize BINARY data | key: deserializeFromBinary
Input | Notes |
---|---|
Input Data code / Required data | Notes BINARY text to deserialize so it can be referenced in a subsequent step. |
#
Output Example Payload{ "data": { "person": { "first": "Bob", "last": "Johnson" }, "dob": "1990-01-01" }}
#
Deserialize CSVDeserialize CSV data | key: deserializeFromCsv
Input | Default | Notes | Example |
---|---|---|---|
Input Data code / Required data | Default | Notes CSV text to deserialize so it can be referenced in a subsequent step. | Example
|
Input CSV Header boolean isHeader | Default true | Notes Specify if your CSV contains a header row. | Example |
#
Output Example Payload{ "data": { "person": { "first": "Bob", "last": "Johnson" }, "dob": "1990-01-01" }}
#
Deserialize JSONDeserialize JSON data | key: deserializeFromJson
Input | Notes | Example |
---|---|---|
Input Data code / Required data | Notes JSON text to deserialize so it can be referenced in a subsequent step. | Example
|
#
Output Example Payload{ "data": { "person": { "first": "Bob", "last": "Johnson" }, "dob": "1990-01-01" }}
#
Deserialize JSON Lines (.jsonl)Transform .jsonl data to a JavaScript array | key: deserializeJsonl
Input | Notes | Example |
---|---|---|
Input JSONL Data code / Required jsonl | Notes | Example
|
#
Deserialize URL-encoded Form DataDeserialize Form Data (x-www-form-urlencoded) | key: deserializeFormData
Input | Notes | Example |
---|---|---|
Input Data string / Required data | Notes Form data to deserialize so it can be referenced in a subsequent step. | Example foo=bar&baz=123 |
#
Output Example Payload{ "data": { "foo": "bar", "baz": "123" }}
#
Deserialize XMLDeserialize XML data | key: deserializeFromXml
Input | Default | Notes | Example |
---|---|---|---|
Input Data code / Required data | Default | Notes XML text to deserialize so it can be referenced in a subsequent step. | Example
|
Input Parse numbers as strings? boolean numbersAsStrings | Default false | Notes Interpret numbers as strings? | Example |
#
Output Example Payload{ "data": { "person": { "first": "Bob", "last": "Johnson" }, "dob": "1990-01-01" }}
#
Deserialize YAMLDeserialize YAML data | key: deserializeFromYaml
Input | Notes | Example |
---|---|---|
Input Data code / Required data | Notes YAML text to deserialize so it can be referenced in a subsequent step. | Example
|
#
Output Example Payload{ "data": { "person": { "first": "Bob", "last": "Johnson" }, "dob": "1990-01-01" }}
#
JavaScript Object to CSVConvert JavaScript Object to CSV | key: binaryToCsv
Input | Notes |
---|---|
Input Data code / Required data | Notes JavaScript Object data to convert to CSV |
#
Output Example Payload{ "data": "\"person__first\",\"person__last\",\"dob\"\n\"Bob\",\"Johnson\",\"1990-01-01\"", "contentType": "text/csv"}
#
JavaScript Object to JSONConvert JavaScript Object to JSON | key: binaryToJson
Input | Notes |
---|---|
Input Data code / Required data | Notes JavaScript Object data to convert to JSON |
#
Output Example Payload{ "data": "{\n \"person\": {\n \"first\": \"Bob\",\n \"last\": \"Johnson\"\n },\n \"dob\": \"1990-01-01\"\n}", "contentType": "application/json"}
#
JavaScript Object to XMLConvert JavaScript Object to XML | key: binaryToXml
Input | Notes |
---|---|
Input Data code / Required data | Notes JavaScript Object data to convert to XML |
#
Output Example Payload{ "data": "<dob>1990-01-01</dob>\n<person>\n <first>Bob</first>\n <last>Johnson</last>\n</person>", "contentType": "text/xml"}
#
JavaScript Object to YAMLConvert JavaScript Object to YAML | key: binaryToYaml
Input | Notes |
---|---|
Input Data code / Required data | Notes JavaScript Object data to convert to YAML |
#
Output Example Payload{ "data": "---\nperson:\n first: Bob\n last: Johnson\ndob: '1990-01-01'", "contentType": "text/yaml"}
#
JSON to CSVConvert JSON to CSV | key: jsonToCsv
Input | Notes | Example |
---|---|---|
Input Data code / Required data | Notes JSON data to convert to CSV | Example
|
#
Output Example Payload{ "data": "\"person__first\",\"person__last\",\"dob\"\n\"Bob\",\"Johnson\",\"1990-01-01\"", "contentType": "text/csv"}
#
JSON to XMLConvert JSON to XML | key: jsonToXml
Input | Notes | Example |
---|---|---|
Input Data code / Required data | Notes JSON data to convert to XML | Example
|
#
Output Example Payload{ "data": "<dob>1990-01-01</dob>\n<person>\n <first>Bob</first>\n <last>Johnson</last>\n</person>", "contentType": "text/xml"}
#
JSON to YAMLConvert JSON to YAML | key: jsonToYaml
Input | Notes | Example |
---|---|---|
Input Data code / Required data | Notes JSON data to convert to YAML | Example
|
#
Output Example Payload{ "data": "---\nperson:\n first: Bob\n last: Johnson\ndob: '1990-01-01'", "contentType": "text/yaml"}
#
Pretty PrintFormat data to be more human-readable | key: prettyPrint
Input | Notes |
---|---|
Input Data text / Required data | Notes Data to pretty print |
#
Serialize JSON Lines (.jsonl)Serialize an array of JavaScript objects into .jsonl | key: serializeJsonl
Input | Notes |
---|---|
Input Array of JavaScript Objects to serialize string / Required array | Notes Must be a reference to an array of JavaScript objects |
#
Serialize URL-encoded Form DataSerialize Form Data (x-www-form-urlencoded) | key: serializeFormData
Input | Notes |
---|---|
Input Data code / Required data | Notes Form data to deserialize so it can be referenced in a subsequent step. |
#
Output Example Payload{ "data": "foo=bar&baz=123"}
#
XML to CSVConvert XML to CSV | key: xmlToCsv
Input | Default | Notes | Example |
---|---|---|---|
Input Data code / Required data | Default | Notes XML data to convert to CSV | Example
|
Input Parse numbers as strings? boolean numbersAsStrings | Default false | Notes Interpret numbers as strings? | Example |
#
Output Example Payload{ "data": "\"person__first\",\"person__last\",\"dob\"\n\"Bob\",\"Johnson\",\"1990-01-01\"", "contentType": "text/csv"}
#
XML to JSONConvert XML to JSON | key: xmlToJson
Input | Default | Notes | Example |
---|---|---|---|
Input Data code / Required data | Default | Notes XML data to convert to JSON | Example
|
Input Parse numbers as strings? boolean numbersAsStrings | Default false | Notes Interpret numbers as strings? | Example |
#
Output Example Payload{ "data": "{\n \"person\": {\n \"first\": \"Bob\",\n \"last\": \"Johnson\"\n },\n \"dob\": \"1990-01-01\"\n}", "contentType": "application/json"}
#
XML to YAMLConvert XML to YAML | key: xmlToYaml
Input | Default | Notes | Example |
---|---|---|---|
Input Data code / Required data | Default | Notes XML data to convert to YAML | Example
|
Input Parse numbers as strings? boolean numbersAsStrings | Default false | Notes Interpret numbers as strings? | Example |
#
Output Example Payload{ "data": "---\nperson:\n first: Bob\n last: Johnson\ndob: '1990-01-01'", "contentType": "text/yaml"}
#
YAML to CSVConvert YAML to CSV | key: yamlToCsv
Input | Notes | Example |
---|---|---|
Input Data code / Required data | Notes YAML data to convert to CSV | Example
|
#
Output Example Payload{ "data": "\"person__first\",\"person__last\",\"dob\"\n\"Bob\",\"Johnson\",\"1990-01-01\"", "contentType": "text/csv"}
#
YAML to JSONConvert YAML to JSON | key: yamlToJson
Input | Notes | Example |
---|---|---|
Input Data code / Required data | Notes YAML data to convert to JSON | Example
|
#
Output Example Payload{ "data": "{\n \"person\": {\n \"first\": \"Bob\",\n \"last\": \"Johnson\"\n },\n \"dob\": \"1990-01-01\"\n}", "contentType": "application/json"}
#
YAML to XMLConvert YAML to XML | key: yamlToXml
Input | Notes | Example |
---|---|---|
Input Data code / Required data | Notes YAML data to convert to XML | Example
|
#
Output Example Payload{ "data": "<dob>1990-01-01</dob>\n<person>\n <first>Bob</first>\n <last>Johnson</last>\n</person>", "contentType": "text/xml"}