Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

Provide the ability to generate JSON output from process data.

The node will allow for authoring a JSON styled template, and will map the output based on field names written into the template.

...

Code Block
languagejson
{
	"Vendor":@@Vendor Name@@,@@PO Field Descriptor@@:@@PO Number@@,
	"Amount":##Invoice@@Invoice Amount##Amount@@,"Invoice Date":@@Document Date@@,
	"Approvers":[
		@@MV Approver List@@
	],
	"Invoice Lines":[@@Line Items[0,1,3,4]@@]
}

Use two @ symbols to represent a process field in the JSON string. Use two # symbols to represent a JSON number. Strings template.

Info

For standard and multi-value fields, Character and Date data types are written as JSON strings, meaning they are wrapped in quotes.

...

Numeric values are written as numeric, meaning no quotes. All table fields are written as character, with quotes.

Multi-value fields are written in their entirety in a comma delimited form. In the example above, @@MV Approver List@@ would be represented like:

...

Code Block
languagejson
"Invoice Lines":[
  {“GL Code”:”100-299300-01”, “Quantity”:”20”,”Amount”:”124.67”},
  {“GL Code”:”100-726352-01”, “Quantity”:”1”,”Amount”:”88.98”}
  {“GL Code”:”100-763521-01”, “Quantity”:”23”,”Amount”:”12.95”}
]

Node Setup

Provide a JSON styled text block in JSON Output.

...

Optionally, the JSON output can be written to a process field on the original process.

Optionally, the output JSON can be validated. Check the “Error process if rendered JSON is invalid”. This option ensures the JSON generated is valid.

...

Workflow

The JSON Export node is a conditional node with two outputs (Original Process and JSON File). There will always be two routes out, but those two paths can merge downstream in the workflow.

...