Adding Fields

Case 1

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:

  1. Add a new field

  2. Copy a field value into the new field

Solution

ImpulseSync can solve this with one job and the add-replace-field manipulator.

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.

Case 2

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:

  1. Add / as a prefix to the slug field being synced.

Solution

ImpulseSync can solve this with one job and the add-replace-field manipulator or the liquid-field manipulator.

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

This config for liquid-field manipulator uses a liquid template to take the content field content.fields.value.slug and uses the prepend filter to add / to the value.

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.

Last updated