Combining data between content types
Last updated
Last updated
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.
This can be solved with ImpulseSync using the and the either the or (using getStoredValue filter) manipulators.
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.
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.
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.
The liquid-field manipulator can also directly retrieve a field value from storage. This can be done using the .