HowTo: text variables
Text is the default variable type in any Docxpresso template, i.e. any variable included in a template surrounded by curly brackets (something like {{variable_name}}) will be assumed by Docxpresso to be a text type variable unless indicated otherwise in the template edition interface.
If we click on a variable (in this case “name”):
The edition interface associated with it will show up as a pop-up:
As you can see there is a plethora of options but fortunately most of the time the default values chosen automatically by Docxpresso will suit your needs.
Let us go one by one about the associated options:
Label
This will be the placeholder name that will show in the end user interface and should, if possible, help the end user that will provide the data with a hint about the content that should be provided:
Tip
The tip will show up when the user rolls the mouse over the variable and it is meant to be a somehow extended description of that variable:
Type
In this case the type is “text”, the default type, is the one chosen and it indicates that the end user should just type the content in the provided “input box”:
Format
This indicates if that variable is expected to have an specific format like email, url, date, etcetera:
Beware that you may define your custom “validation” formats under the Resources > Create Validation of the main left side menu of the Docxpresso backoffice interface.
Value
If not empty Docxpresso will automatically associate this value to that variable under a first edition of the document.
Although this may seem redundant because the placeholder label may play that role it is important to notice that this may play a role regarding validations because while the variable value coincides with the label Docxpresso assumes it is “empty”. It will also play a role with other type like date or numeric as well as in the web form interface of the template.
Editable
This checkbox indicates if the variable is editable (default value). If unchecked this field cannot be directly edited by the end user. This functionality usually only plays a role whenever external data is preloaded in the template and we want to limit the editing capabilities of the user fulfilling the document.
Confirm
This checkbox indicates if the variable should be “confirmed” by the user before submitting the data. It should only be used in the case a variable is “critical” like an email, ID number, phone, etcetera and we want to make sure that the introduced value is correct.
If checked in this case the end user will be prompted to repeat its value just before submission:
Global
Docxpresso assumes all variables are global unless they are inserted within a “clonable group” like a table, a list or bookmarked content.
It means is that if a global is repeated many times along a document there is no need to retype its value because it will automatically translate everywhere else in the document:
But within a clonable table element, for example this is not the desired behavior:
In the above case even if the names of the variables in the first and second row are identical they may hold different values:
Compulsory
If checked that variable cannot be left empty or with the wrong format otherwise the user will be warned upon submission.
Beware that this is not enough to block the submission of the document and you should also check the “enforce validation” checkbox of the general settings panel. We have chosen to do so because in may use case scenarios the document is long and complex and it is not fulfilled in a single session and/or by just only one end user.
Service
If checked the variable will be associated to one of the available external services predefined in the application, i.e. data will be loaded on real time from an external source.
Like this is kind of advanced feature that generally speaking requires of the intervention of a qualified web developer or IT department we will not elaborate on it here.
Extended help
This WYSIWYG interface allows to generate extended help info that will show up in the document margins in this fashion (we have highlighted it in yellow in the accompanying image):
Link
And finally this option allows to introduce an URL with additional info that may be of use to the end user.
If we introduce a non empty value, for example:
The end user interface will show up a button:
That when clicked will open a popup where the given URL will be loaded:
Beware that many websites protect their pages to be shown within a popup in another website so, please, first check if this procedure is allowed.