Adding Fields
Last updated
Last updated
Assume the destination content type has an additional field that should match the value of another field. i.e., Mobile headline value should match headline value. But the destination has both headline and mobile headline fields, while the source only has healdine.
We need to be able to:
Add a new field
Copy a field value into the new field
First we create a job to sync the content. In this job we will want to configure an add-replace-field manipulator.
This config will add a new field or replace the field if it already exists. Given our case, this will add a new field. The new field will have the value that the field title
has.
When this job runs we can see that the destination has both fields populated with the same values.
Assume there is a required adjustment to a field being synced over. i.e, a slug value must be prefixed with /
.
We need to be able to:
Add /
as a prefix to the slug field being synced.
First we create a job to sync the content. Then we will decided which manipulator to use.
add-replace
This config for the add-replace-field manipulator uses a combination of static values and dynamic values. The static value is the /
added before the {{slug}}
. The dynamic value is the {{slug}}
where the current value for the slug
field is set here.
liquid
Once this job runs we can see that the destination field now has the /
character prepended to it's value.
This solution can be used for any static values mixed with another fields value. Such as setting the title value in the middle of a static value.
ImpulseSync can solve this with one job and the .
ImpulseSync can solve this with one job and the or the .
This config for liquid-field manipulator uses a liquid template to take the content field content.fields.value.slug
and uses the to add /
to the value.
add-replace
liquid