Below is a list of workflow actions available for Text Processing.
. dot to navigate through nested objects or arrays..[index] to access specific elements in an array..["some property"].. to modify the entire content. To be able to update the entire content is useful if the JSON or YAML is a simple string or integer instead of an object, for example, "simple-string".You may encounter double curly braces templating syntax when dealing with JSON or YAML files.
workflow expressions also use double curly bracket notation.
It is possible to escape {{ and }} with {{ '{{' }} and {{ '}}' }} respectively, however; actions provided by Text Processing only support valid JSON or YAML syntax.
Should the expression evaluation result yield an action input that is not considered valid in respect to JSON or YAML, the workflow execution state is Error.
In the official Jinja documentation, read more about escape mechanisms.
Configures a JSON file.
Field
Description
Required
Example syntax
JSON content
The full content of the JSON.
required
{ "obj1": { "innerObj1": { "array": [ { "theObjectInsideTheArray": "value1" }, { "theObjectInsideTheArray": "value2" } ] } } }
Path
The path to the property that is added or changed.
required
.obj1.innerObj1.obj1.innerObj1.array[2].theObjectInsideTheArray.["some property"].[0].someObjectInTheToplevelArray.Value
The new value for the property path.
required
{"new-key": "new-value"}
{json: <updated json content>}
This is an example input for the Set JSON value action where we change the value of name from "Max" to "Michael".
JSON content
{"persons": [{"name": "Max"},{"name": "John"}]}
Path: .persons[0].name
Value: "Michael"
This is the result of running the Set JSON value action as part of a workflow. The first name was changed to Michael.
{"persons": [{"name": "Michael"},{"name": "John"}]}
Manipulates a YAML. Supports multi-document YAML files.
Field
Description
Required
Example syntax
YAML content
The full content of the YAML.
required
obj1:innerObj1:array:- theObjectInsideTheArray: value1- theObjectInsideTheArray: value2
Path
The path to the property that is added or changed.
required
.obj1.innerObj1.obj1.innerObj1.array[0].theObjectInsideTheArray.["some property"].[0].someObjectInTheTopLevelArray.Value
The new value for the property path.
required
'new-value'
Document index
Relevant only for YAML files containing multiple documents. Index starts at 0.
optional
obj1:key: value1---obj2:key: value2
To modify the second document, set documentIndex to 1.
{yaml: \<updated yaml content>}
This is an example input for the Set YAML value action where we change the value of name from "Max" to "Michael".
YAML content
---persons:- name: John- name: Sarah---persons:- name: Max- name: Jeff
Path
.persons[0]
Document index 1
Value
{ name: "Michael" }
This is the result of running the Set JSON value action as part of a workflow. The name was changed to Michael.
persons:- name: John- name: Sarah---persons:- name: Michael- name: Jeff
Retrieves a value from a JSON file.
| Field | Description | Required |
|---|---|---|
| JSON content | The full content of the JSON. | required |
| Path | The path to the property that is retrieved. | required |
JSON content
{"person": {"name": "John Doe""age": 30,}}
Path: .person
{json: {name: "John doe",age: 30}}
Retrieves a value from a YAML file. Supports multi-document YAML files.
| Field | Description | Required |
|---|---|---|
| YAML content | The full content of the YAML. | required |
| Document index | Relevant only for YAML files containing multiple documents. Index starts at 0. | optional |
| Path | The path to the property that is retrieved. | required |
YAML content
person:name: "John doe"age: 30
Path: .person
{yaml: 'name: "John Doe" age: 30'}
WorkflowsSoftware Delivery