Why should you use a template ?
It is possible to have a set of widgets repeating on all of your forms.
By creating a template, it is possible to insert this content into all of the desired forms.
What is a template ?
A template is a set of widgets that can be reused in several forms.
Warning: A template is not a form as such: it is a component of a form. Thus, the template alone is not visible on the mobile application: it is only visible through forms that contain the template !
For example :
Imagine a company inspecting rails. We have two types of interventions, so two types of forms:
- Track control.
- Replacement of rails showing a defect.
In practice, how do you create and use a template ?
Context : Imagine a company that performs two types of interventions : maintenance and inspection. A Maintenance form and an Inspection form are thus created.
Both forms must start with a General data section. This part will include information concerning the operator carrying out the intervention.
We are going to create a template called General Data. This template should allow the following fields to be filled in :
- Operator name
- Operator first name
- Place of intervention
This template will then be inserted into Maintenance and Inspection forms
1. In the Documents tab, click on New document.
2. Define the name of the model (here General data). For the document type, choose Template. A template is represented by an orange symbol next to the name of the form.
3. Click on Edit form.
4. We will insert the different widgets making up our form.
4.1 Drag and drop a Text widget. Name it "Operator Name".
4.2 Drag and drop a Text widget. Name the "Operator First Name".
4.3 Drag and drop a Location widget. Name the "Place of the intervention".
5. Make the template active and publish it.
6. Open the Inspection form then click on Edit form.
7. Drag and drop a Model widget.
8. Choose the General data template from the list of documents.
9. Your template is now inserted in the Inspection form.
NB: If you want to make modifications within the General Datas template only for the "Inspection" form, you will have to convert the template into a section.
To go further
- Templates do not appear on the Documents page of your mobile app. They are not intended to be used alone by the user. In this case, the Form widget should be use.
- When a template is inserted in a form, it is not possible to set conditions on this model.
- A multilingual template cannot be converted to a section within a form.