Sam Webster
Created Jan 24, 2024Configuring basic variable text within the Form Builder | FB_014
The basic tutorials on the Form Builder have covered dealing with the entire form. For example, we are providing a text box where the entire contents of that text box is controlled by one of our form fields. But what if we want to only change part of the text within a text field.
In this example, we'll cover this functionality by showing you how to configure basic variable text in the Form Builder. Our example will result in a text field which contains static text of "My name is", followed by variable text which is entered by the user on the form.
Controls the string of text that precedes and follows our variable name. This allows us to easily define where a variable is to be used on our product.
So, for example, if the prefix and postfix are "[++" and "++]" respectively, and the variable name is "Variable", our complete text string entered onto our template in order to use this variable is "[++Variable++].

This is how we can define our custom variables. In the script editor, you will see a range of informative text showing how this is configured and populated.
For our example, I'm going to copy this content as a template for our custom variable and paste it into the global configuration of our Form Builder script.

This does not have to be filled in, however if you would like the variable to show some predefined text, it can be specified here.
This can be static text, or you can utilise existing user data. For example, inputting "LoadUserData: FirstName,LastName" will populate the field with the name of the logged in user (if it has been defined on their account).
Available fields are listed in the script editor and include names, address fields and email.

Allows you to optionally define if any text should precede or follow the variable value. In our example, we'll input "--" so we can demonstrate this for clarity. This could be used for spacing, consistent static text and more.
One other use case is to automatically input a line break using /n. We'll cover this in more detail on another tutorial.
