Skip to main content

Templates

What are JSLT Templates:
JSLT templates are used to transform the JSON from one form to another. these templates are capable of flattening the data, deleting the data, and renaming the fields inside the JSON.
In configuration, we can define templates at three levels.

  1. Integration level, for example, we can have one template to transform all the payloads coming from all the CRMs.
  2. TenantAdapter level i.e., we can have one template placed at the tenant adapter level of a particular tenant, which can help transform all the payloads coming from that particular adapter. for example, all the payloads coming from the salesforce will be transformed for a tenant.
  3. Endpoint level i.e., we can have a template defined at each endpoint level of a particular tenant adapter of a tenant, this will transform the payload for that particular endpoint.

How to query a template:
In the marketplace, templates follow this precedence: endpoint > tenant adapter > integration.
first, it will check whether a template is defined at the endpoint level, if it doesn't find one then it checks at the tenant adapter level, and then at the integration level.

if you do an HTTP GET request to v1/tenants/{tenantId:guid}/templates?tenantAdapterId={tenantAdapterId}&endpoint=customer with tenant adapter id and endpoint name as the query parameters, it will first check whether a template exists at the endpoint level, if it doesn't find it there, it will check at the tenant adapter level, if not found it will check at the integration level.