Combining data between content types

Case

During IA changes, there may be times when data from one content type needs to merged with another content type. I.e. The name of a referenced content needs to be set as a text field instead of a reference. Or a the content ID needs to be retrieved based on a text value.

Solution

This can be solved with ImpulseSync using the store-field manipulator and the either the get-set-field or liquid-field (using getStoredValue filter) manipulators.

Using these manipulators requires the proper storage. To permanently save the stored data you must be subscribed to an appropriate plan and additional charges may occur. To permanently save the data, use the storeContent job option in the endpoints that should use permanent storage.

Otherwise, any jobs that will be using these manipulators must be in the same pipeline. All jobs in a pipeline will use the same temporary storage which will be deleted once the pipeline is finished.

The first step is to run a job with the store-field manipulator configured. This will allow data picked up by the job to be stored.

The manipulator can be configured to store a field using the endpoint ID, language ID, and field ID with config similar to the following.

Or you can use liquid templates to use a different key and/or choose the stored value.

Once the job(s) to store data are configured you can then create a job to retrieve the stored data. Data can be retreived with either the get-set-field manipulator or the liquid-field manipulator using the getStoredValue filter.

The config for get-set-field manipulator would be similiar to the following.

The above config would get the field image previously stored with the first store-field config.

Alternatively, you can use a liquid template to create the key to retrieve a value from storage with.

The above config creates a key using a parsed value from the source content to search for the data previously stored with the second store-field config where a key was created using a liquid template.

The liquid-field manipulator can also directly retrieve a field value from storage. This can be done using the getStoredValue filter.

This config uses a liquid template to again create a key using a parsed value from the source content to search for the data previously stored with the second store-field config where a key was created using a liquid template. It retrieves the value by using the getStoredValue filter in the liquid template.

But instead of simply retrieving the field and setting it in the content, the liquid template creates a relationship field to deliver with the stored data as the related content's ID.

Source vs. Destination

Using these options allows for changing a text value from the source to a relationship at the destination.

Or remove a reference in the middle of a 3 chain reference.

As well as many other use cases for merging or adjusting contents between content types.

Last updated