Template generation in Appian
Overview
Apryse's office template generation framework enables the dynamic generation of PDFs:
You provide a template in the form of an Office document (such as .docx)
You provide replacement data in JSON form
Apryse SDK will efficiently generate a PDF by merging the data with the template
Fully featured, with support for loops, conditionals, images, table generation, etc.
Use your preferred office editor to design attractive templates, and Apryse will take care of the rest
All logic is entirely contained within the SDK, with no external dependencies
Template Structure
If you have an Office document with template values that look like this:
{{sender.name}} // object structureor
{{first_name}} // normal tagYou can insert values to replace those template placeholders. This can be done in various ways.
Filling a Template
The first is to set the templateDataValues parameter with a object that has keys that match the ones in the template and their associated value. They can be objects as seen in the placeholder key example above. Here is a sample of how this could look like in expression mode in Appian Designer:
Manually set values with modal
You can also enable the enableDocumentGeneration parameter to gain access to a modal that allows users to manually set those values. This is, however, limited to just text/numerical values.
Additional documentation
For more details, such as complex use cases like conditionals, loops, images and more visit our WebViewer guide on generating via template.
Last updated
Was this helpful?