Structured values

Structured values are values which are composed of more than one field. For example, a postal address has fields for the various lines in the address, and a person’s name has values for the various parts of the name.

Each of these different parts may need to be mapped or transformed, so a two step process is used to convert these types from the input data.

1. Copy values to pseudo-destination

Each of the structured data types has an associated pseudo-destination, which has Names for each of the fields. These pseudo-destinations show up in the Model, and are named with a prefix of "value:".

Use the normal field and set-value Instructions to set the fields in this pseudo-destination. This allows all the value conversion features to be used on the input data.

Use the admin UI to see the Names in these pseudo-destinations.

Each Name in the pseudo-destination is copied individually. If the input data includes these values as properties of a nested JSON structure, use the within Instruction to move within the structure.

2. Set value from the pseudo-destination

Once all the values have been set in the value type’s pseudo-destination, use the field-structured Instruction to assemble the structured value and set it in the final Destination.

This Instruction clears the pseudo-destination ready for the next value to be assembled.

Example

These Instructions copy values from the input Record into the person’s name pseudo-destination, then apply it to as the name in the profile object representing that person in the object store.

{ "source":"T", "destination":"value:person-name", "name":"title"  },
{ "source":"F", "destination":"value:person-name", "name":"first"  },
{ "source":"M", "destination":"value:person-name", "name":"middle" },
{ "source":"L", "destination":"value:person-name", "name":"last"   },
{ "source":"S", "destination":"value:person-name", "name":"suffix" },
{
    "action": "field-structured",
    "structured": "value:person-name",
    "destination": "profile",
    "name": "dc:attribute:title"
}

The person’s name goes in the dc:attribute:title name, because as this is the Dublin Core attribute for the ‘name’ of a thing.