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.
(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.
Create the User Rental agreement.
This Data item contains the Tenant (a reference to one User) and a Property for each section.
Step 2: design the Flow part Lookup rental agreement text
This Flow part fills the rental agreement with content from the Template.
- Input: the created Employment contract.
- Depending on the choices in the Pick lists, retrieve the content from the Template that applies.
- Update the contract with the content from the Template.
Step 3: design the Flow part Fill Rental agreement that fills the placeholders
First, define the Inputs. Every placeholder is an Input.
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:
For the other Calculations, use the previous formula:
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.
The flow process
-
Add a Rental agreement. This Page contains Form fields for the tenant and the start and end dates.
-
From there, create a rental agreement with only these Properties.
-
Call the Flow part Lookup Rental agreement text. This will fill the contract with the applicable content, depending on the selections in the Picklist.
-
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.
-
Call the Flow part Fill Rental agreement that replaces the placeholders with the provided content. Provide the necessary Inputs.
-
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.
The PDF file setup
The final PDF file
The process