Set
Synopsis
Sets a field and associates it with a specified value.
Schema
set:
- field: <ident>
- copy_from: <ident>
- description: <text>
- if: <script>
- ignore_empty_value: <boolean>
- ignore_failure: <boolean>
- media_type: <enum>
- on_failure: <processor[]>
- on_success: <processor[]>
- override: <boolean>
- tag: <string>
- value: <any>
Configuration
Field | Required | Default | Description |
---|---|---|---|
field | Y | - | Field to update |
copy_from | N | - | Field whose value will be copied to field . Cannot be used if value is specified |
description | N | - | Explanatory note |
if | N | - | Condition to run |
ignore_empty_value | N | false | If true , quietly exit if specified field does not exist or its value is null /empty |
ignore_failure | N | false | See Handling Failures |
media_type | N | application/json | For encoding value . Valid options: application/json , text/plain , or application/x-www-form-urlencoded |
on_failure | N | - | See Handling Failures |
on_success | N | - | See Handling Success |
override | N | true | If false , do not update fields that already have a non-null value |
tag | N | - | Identifier |
value | N | - | Value to set. Cannot be used if copy_from is specified |
Details
The processor can either set a literal value or copy a value from another field. If the field already exists, its value will be replaced unless override
is set to false
.
Either value
or copy_from
must be specified, but not both. When using copy_from
, the source field must exist unless ignore_empty_value
is set to true
.
When using templates, ensure that they reference valid fields as missing fields will cause the processor to fail unless ignore_empty_value
is enabled.
Examples
Basic
Setting a simple numeric value... |
|
creates a new field with that value: |
|
Templates
Values can reference other fields through templates... |
|
which get resolved at run time: |
|
Array Templates
Set arrays with mixed values... |
|
combining static and dynamic values: |
|
Map Templates
Set maps with template values... |
|
creating structured data: |
|
Copying
Copying a value from one field to another... |
|
duplicates the value: |
|
Existing Values
When existing values are not overridden... |
|
non-null values are preserved: |
|