Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

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.

Example Template:

{
	"Vendor":@@Vendor Name@@,@@PO Field Descriptor@@:@@PO Number@@,
	"Amount":@@Invoice 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 template.

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:

“Steve”, “Brian”, “Dan”

This results in a valid JSON structure when injected into the JSON as defined:

"Approvers":[
  "Steve","Brian","Dan"
]

Table fields are written in their entirety (all rows) for the table columns specified. All Table Field columns are written as strings. In the example above, @@Line Items[0,1,3,4]@@ will output an object for each row:

{“GL Code”:”100-299300-01”, “Quantity”:”20”,”Amount”:”124.67”}

This results in a valid JSON structure when injected into the JSON as defined:

"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.

Original Process

The original process is the standard route the source document should take in the workflow.

JSON File

The node, on successful processing of the process' data, will spawn a new workflow process and attach the JSON output as a file in that new process. This will allow the JSON output and the file output to potentially take two different paths if that’s necessary for the workflow.

There will ALWAYS be two processes on successful processing of this node. Cloud customers should note that this will add 1 page to the page count consumed.

Field Names should not contain square brackets.

  • No labels