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.)
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.
This flow part fills the rental agreement with content from the template.
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.
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.
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.