Skip to main content
Version: 4.52.0

Template Engine

This component allows you to format data using a Handlebars template. The result will be a rendered template based on the input. it can be used to template JSON, XML, CSV, and HTML files.

Configuration

Inputs | Outputs


Template Engine
Input
Output
Error
00 0 (ilywsx2)

An object containing the values for template variables, conditions, loops or filters. The following input is used for two different custom example templates:

  • Example: Normal input
  • {
    "_id": "12345",
    "kind": "BINARY",
    "migration": {
    "migrate": true
    },
    "source": {
    "rawExtension": ".xlsx",
    "extension": ".xlsx",
    "byteSize": 5943,
    "properties": {
    "category": [1, 2, 3]
    }
    }
    }

  • Example: Template XML

  • <?xml version="1.0" encoding="utf-8"?>
    <file>
    <kind>
    "{{ kind }}"
    </kind>
    </file>

  • Example: Template JSON
  • {
    "_id": "{{_id}}",
    "kind": "BINARY",
    "migration": {
    "migrate": true
    },
    "source": {{stringify source}},
    "target": {
    "rawExtension": "{{source.rawExtension}}",
    "extension": "{{source.extension}}",
    "byteSize": {{source.byteSize}}
    }
    }