2022.2

Table Of Contents
l
www.json.org
l
www.w3schools.com
JSON support in Workflow tasks and scripts
PReS Workflow offers JSON support in and via the following tasks:
l
The "XML/JSON Conversion" on page404 task converts an XML job file to JSON or a JSON job
file to XML.
l
The following OL Connect tasks accept JSON data as input: "Create Email Content" on
page500, "Create Print Content" on page513, "Create Web Content" on page516, "Render
Email Content" on page533, and the "Create Preview PDF" on page509 task.
l
When the OL Connect "Execute Data Mapping" on page522 task or the OL Connect "Retrieve
Items" on page537 task is set to output Records in JSON, it outputs a JSON Record Data List
(see "Types of JSON in Workflow" below).
l
The OL Connect Send "Get Data" on page481 task can output its results to a JSON file.
In scripts written in any JSON-aware language (including JavaScript), JSON is obviously supported.
Certain methods in the "Data Repository API" on page146 accept or return JSON data.
Types of JSON in Workflow
Workflow tasks that support JSON accept or output one or two of the following types of JSON:
l
a regular JSON string, containing a JSON object or an array of JSON objects representing
records. If a value in a record object is a string, it is considered to be a field value. If a value in a
record object is a JSON object, it is considered to be a nested table with detail records. For
examples, see "JSON string examples" below.
l
a JSON Record Data List (see the REST API Cookbook). A JSON Record Data List is a pro-
prietary JSON object type. It includes a schema entry with information about the types of all
fields at the beginning of the record, and the data set with values after the schema. This structure
allows for easy handling of REST API return values through scripting in Workflow or in the
Designer; see "JSON Record Data List example" on page79.
JSON string examples
The following JSON string samples show various techniques to incorporate data in a JSON string.
A simple JSON structure holding the first and last name of a person:
{
"first": "Peter",
Page 77