How do I get Json data and HTML template to work in OL Connect workflow? I was provided a JSon data file and a HTML template. That needs to run through a Planetpress workflow to produce pdf letters. How do I get them both to work?
Provided that the JSON data already has the right setup for your need it is easy as:
In Connect Designer
- File-> Add Data → JSON Sample Data…
- Select your JSON data
- Check Replace Data Model
In Workflow:
- In the Create Web content plugin
– Set Data Source to JSON
Some extra info
Preparing the template
I’d place the contents of the element of your HTML in Print template created in OL Connect Designer. In OL Connect Designer use the Add Data option as described by jchamel to load the data, this generates the Data Model.
Add the desired fields from the Data Model to the content using drag and drop. This inserts placeholders (aka Handlebars expressions) in the content, these are basically data field names wrapped in double curly braces. These will be replaced with the corresponding data when generating output.
Setting up Workflow
Upload the template from OL Connect Designer to OL Connect Workflow (File > Send to Workflow). Create a simple workflow to capture the JSON file (for example using an Folder Capture step). For simplicity sake I would add the Create Preview PDF task assuming each JSON file generates a single PDF letter. In this scenario you can set the data Source to JSON String and add %c (current job data) to the JSON String field.