Transformation Template

Templates are valid JSON documents with special keys and fields used to describe how the template should be applied to the underlying data.

Example Template

{
  "address": "$mapping(address, $(First(\"Locations_List\", \"Address\")))",
  "vendors": [
    {
      "#each": "$(<ERP_Record>)",
      "#if": "$(<Ready_To_Transact> <> \"n\")",
      "#inline": "$mapping(vendor)",
      "bank": "$mapping(banking)",
    }
  ],
 "contacts": [
    {
      "#inline": "$mapping(payment_contact)"
    },
    {
      "#inline": "$mapping(ordering_contact)"
    },
    {
      "#inline": "$mapping(support_contact)"
    },
    {
      "#inline": "$mapping(sales_contact)"
    }
  ],
}

Template Operations


OperationTypeDescription
$mapping(name[, context])Special ValueApply the mapping to the fields in the current context. Optionally, include a Graphite Expression as a 2nd parameter to specify the context.

Mappings are defined and named in the Transformation Mapping sheet.

The default context is the full profile, or the root of the JSON document.

When in an #each loop, the default context is the current instance of the loop.
$(expression)Special ValueA graphite expression. The result of which will be used as that field’s value.
# eachSpecial Key NameUsed to apply a template, the sibling keys in the current object, to an array of objects. The value of the #each key must be a Graphite Expression returning a multiple group.
# ifSpecial Key NameCan be used in any object. The value of the #if key must be a Boolean Graphite Expression. If the expression evaluates to false, the object will not be included in the output.
# inlineSpecial Key NameCan be used in any object. The value of the #inline key must be a $mapping operation. The results of the mapping will be inlined in the current object, all the resulting fields will be copied as siblings of the #inline key field.
# flattenSpecial Key Name
# hideArrayIfSpecial Key Name
$itemSpecial Value
$instancesSpecial Value
$indexesSpecial Value