Topics and lessons

Building a placeholder system for emails and documents

Building a placeholder system is very handy for re-using email and document templates sistematically. An example: your company has a rental agreement template which is used to generate individual agreements. For every agreement, some parts have to be selected or filled in, depending on the situation.

Instead of creating a bunch of templates which forces the employee to select the right template, there is only one template in which you can use specific text, depending on choices.

Depending on choices in Pick lists, the application selects certain pieces of the template and creates an Rental agreement with the applicable content from the template.

After that, the only thing the employee needs to do is to fill the placeholders. The application then replaces the placeholders with their content and generates a PDF file.

In this example, we'll show you how to build this with a rental agreement:

  1. Set up the data items
  2. Design the flow part Lookup rental agreement text
  3. Design the flow part Fill Rental agreement that fills the placeholders
  4. Create the user flow Rental agreements
  5. Create a flow part to generate the PDF

(Note that we won't use the complete agreement, but just enough to show you how it works.)

Step 1: set up the data items

First create the Contract template.

Every section in the contract has its own property. We have two sections: Intro and End date.

The content of section End date depends on a choice (end date or not). There is a property for both options.

Rental agreement template. Triggre no-code web app builder.

Create the User Rental agreement.

This data item contains the tenant (a reference to one User) and a property for each section.

Property. Triggre no-code web app builder.

Step 2: design the flow part Lookup rental agreement text

This flow part fills the rental agreement with content from the template.

Flow part. Triggre no-code web app builder.
  1. Input: the created Employment contract.
  2. Depending on the choices in the Pick lists, retrieve the content from the template that applies.
  3. Update the contract with the content from the template.

Step 3: design the flow part Fill Rental agreement that fills the placeholders

Flow part fill rental agreement. Triggre no-code web app builder.

First, define the inputs. Every placeholder is an input.

Define inputs. Triggre no-code web app builder.

For every input, create a Calculation that replaces the placeholder with the applicable input.

In the first calculation, use the applicable section of the Employment contract:

First calculation. Triggre no-code web app builder.

For the other calculations, use the previous formula:

Other calculations. Triggre no-code web app builder.

Update the contract with the modified sections. You can do this per section after the flow has replaced all placeholders in it, or do it at the end for all sections at the same time.

Step 4: create the user flow Rental agreements

Create the user flow using the wizard.

Change the appearance of the form fields for sections in the Create and Edit pages to from Simple to Multiple lines of text.

User flow rental agreement. Triggre no-code web app builder.

The flow process

  1. Add a Rental agreement. This page contains form fields for the tenant and the start and end dates.
Add a rental agreement. Triggre no-code web app builder.
  1. From there, create a rental agreement with only these properties.
  2. Call the flow part Lookup Rental agreement text. This will fill the contract with the applicable content, depending on the selections in the picklist.
  3. Create the page Fill placeholders. The left side of the page shows the sections in the contract. The right side of the page shows the Form fields for the content of the place holders.
Fill placeholders. Triggre no-code web app builder.
  1. Call the flow part Fill Rental agreement that replaces the placeholders with the provided content. Provide the necessary inputs.
  2. Proceed to the Overview page or an Edit page, where the rental employee can modify the agreement where needed.

Step 5: create a flow part to generate the PDF

Now you collected all information, you can create a PDF. In the PDF you can create a good looking document with additional information like contact and logo.

Design a flow part to do this. Store the PDF in the agreement.

You can also send an email to the tenant with the PDF attached.

Flow part. Triggre no-code web app builder.

The PDF file setup

PDF example 1. Triggre no-code web app builder.

The final PDF file

PDF example 2. Triggre no-code web app builder.

The process

Add rental agreement. Triggre no-code web app builder.
Fill placeholders 2. Triggre no-code web app builder.
Edit user employment. Triggre no-code web app builder.
Rental agreement overview. Triggre no-code web app builder.