JSON
Conversion
This group turns a loaded JSON document into another format — compact JSON text, XML, or CSV — or brings XML in as JSON. Three of the instructions read the loaded document and save the converted result under a name for later steps to use; the fourth (Convert XML To JSON) works the other way round — it reads XML text and loads it as a new JSON document.
Prerequisite: mixed. Compact JSON, Convert JSON To XML and Convert To CSV need a JSON document to already be loaded — created with Create JSON file or opened with an Opening instruction. Convert XML To JSON is an entry-point instruction: it needs no document beforehand — it creates one from the XML you give it.
These concepts recur across the instructions in this group; they are explained here once.
- Two kinds of instruction. Three of them read and convert: they take the loaded document, produce text in another format, and save that text — they never change the document itself. The fourth, Convert XML To JSON, loads new data: it turns XML into a loaded JSON document.
- Save the result (
Save …): for the read-and-convert instructions, the converted text is only kept if you fill the Save … field. Leave it empty and nothing is produced. Save it under a name and later steps can use it with@name. - Document: the Document key names the loaded document to convert. If you leave it
empty, the current document is used. It also accepts
@name. - Name and Path (Convert XML To JSON only): where the newly loaded document will be written when you save it later. They are independent of the XML source — you can read XML in and save the result somewhere else. If left empty, the document is still loaded but has no save location of its own yet.
- Dynamic values
@name: the text fields — Document key, Delimiter, Root element name, XML content, Name, Path — accept a saved value: type@followed by its name and the engine substitutes the value at run time. - Nothing is written to disk here. These instructions produce a value (or load a document); a later save instruction writes it out.
Compact JSON .json
Turns the loaded JSON document into compact, single-line JSON text — every optional space and line break removed — and saves it under a name.
When to use it: to produce a minimal-size version of the data, for example to send it to a service that wants JSON on one line, or to store it compactly in a saved value.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document key | The loaded document to convert. Empty = current document (accepts @name) |
(empty) | No |
| Save key | Saves the compact JSON text under this name | (empty) | No |
Important behavior: if Save key is empty, nothing happens and nothing is saved. If no document is loaded, nothing happens. The document itself is not changed — only a compact text copy is saved.
Convert JSON To XML .json
Converts the loaded JSON document into XML text and saves it under a name.
When to use it: when another system or step expects XML instead of JSON.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document key | The loaded document to convert. Empty = current document (accepts @name) |
(empty) | No |
| Root element name | The name of the single outer XML element that wraps everything (accepts @name) |
root |
No |
| Save XML key | Saves the resulting XML text under this name | (empty) | No |
Important behavior: if Save XML key is empty, nothing happens and nothing is saved. If
Root element name is left empty, root is used. If no document is loaded, nothing happens.
The XML is produced indented (readable) and without the <?xml …?> declaration line.
The document itself is not changed.
Convert To CSV .json
Converts the loaded JSON document — which must be a list of records — into CSV text (a table of rows and columns) and saves it under a name.
When to use it: to turn a list of JSON objects into a spreadsheet-style table for export or further processing.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| Document key | The loaded document to convert. Empty = current document (accepts @name) |
(empty) | No |
| Delimiter | The character that separates columns (accepts @name) |
, |
No |
| Include header | If yes, writes a first row with the column names | Yes |
No |
| Include header (from variable) | Reads the yes/no value from a saved value | (empty) | No |
| Save CSV key | Saves the resulting CSV text under this name | (empty) | No |
Important behavior: the loaded document must be a list (array) with at least one element. A real data file rarely holds its list at the root — it usually hangs off a field, next to a title or a date — and pointing this instruction at such a document does nothing and says so: open the list inside it with Read Nested JSON .json and convert that one instead. The same happens when the list is empty. The columns are the union of all field names found across the objects in the list, in the order they are first seen; if no element is a record with fields there are no columns, and that is said too. Elements that aren’t objects are skipped as data rows. If Delimiter is empty, a comma is used. Any value containing the delimiter, a double quote, or a line break is wrapped in double quotes (and inner quotes doubled) so the CSV stays valid. If Save CSV key is empty, nothing happens.
Convert XML To JSON .json
Reads XML text you provide and loads it as a new JSON document in the workflow.
When to use it: to bring XML data into the workflow so the JSON instructions can work on it — this is an entry-point instruction, so a workflow can begin with it.
| Parameter | Meaning | Default | Required |
|---|---|---|---|
| XML content | The XML text to convert (accepts @name) |
(empty) | Yes |
| Name | File name the new document will be saved under (accepts @name); needed to save the document — this instruction has no source file to take a destination from |
(empty) | Yes |
| Path | Folder the new document will be saved to (accepts @name); needed to save the document — this instruction has no source file to take a destination from |
(empty) | Yes |
| Document key | Names the new document so later instructions can target it. Empty = current document (accepts @name) |
(empty) | No |
Important behavior: if XML content is empty (or only spaces), nothing is loaded. The XML must be well-formed. The converted JSON becomes a loaded document (the current one if Document key is empty); Name and Path set where it will be written when you later save, and are independent of the XML source. Nothing is written to disk here.
This documentation is the help of the application, and it comes underCreative Commons Attribution 4.0.