Add Replace Field
The add-replace-field
manipulator adds a field to the definition of a content type and, also, could replace the value of an existing field.
You can use this manipulator to copy values from an existing field in the content type or to set a default value for the new/updated field.
Properties
It is important to note that all these field...
(i.e. fieldId
, fieldType
, etc) properties are motation properties, they have to use the same syntax as the motation system. Just like the ones used in the connector's Transformers.
Property | Purpose | Required |
---|---|---|
runManipulator | When to run this manipulator? Set one of the following options: | True |
runManipulatorRegex | Regular Expression to match the Field Value | Only when |
fieldId | ID of the field to add | True |
fieldType | Type of the field to add | True |
fieldValue | Value to set for the field | True |
fieldName | Name of the field to add | False |
fieldSystemType | Motation System type of the field to add | False |
fieldOrder | Order of the field to add | False |
Specifics
How to use
It is very straightforward to use this manipulator. You just need to:
Set
runManipulator
to one of the options and set therunManipulatorRegex
if you selectedREGEX
in the previous step. Note: if you select a non-valid option, the manipulator will selectFIELD_NOT_EXISTS
by default. The options are:ALWAYS
will always run the manipulator.VALUE_EMPTY
will run the manipulator only if the value of the field is empty or doesn't exist.FIELD_NOT_EXISTS
will run the manipulator only if the field doesn't exist.REGEX
will run the manipulator only if the value of the field matches therunManipulatorRegex
.
Set the
fieldId
,fieldType
andfieldValue
properties. Like you would do in the motation system.
applyOn
This manipulator can be used only on read
fieldType
It could be any of the Motation's TypeEnum
, for example: String
BigString
Boolean
Integer
BigInteger
Decimal
Float
...
These Field type values are what we use in relation to our motation in order to manipulate the content these exact motation field types can be found in our Connector Matrix
fieldValue
The fieldValue
property can be set to a hardcoded value or to another field value using brackets {{another-field-id}}
. For example, if you want to set the value of the field to the value of another field, you can do it like this:
Let's say you "Headline" at source needs to be "Headline" and "Mobile Headline" at destination. You can do it like this:
Assuming you have a field called "Headline" in your content type, with an id of "headline", the value of the field "mobileHeadline" will be the value of the field "headline".
You could even merge fields, like this:
Examples
This would be the API call for a job with this manipulator (also using Regex manipulator):
Last updated