Reference Variables in DOC GEN Documents

SKIP AHEAD TO 
Why would you reference variables in DOC GEN documents?
How can you reference variables inside DOC GEN documents?
Is there an easier way to reference variables inside DOC GEN documents?
Can referenced variables be styled and formatted?
Can Variables with Field Formatting be carried over?
Limitations

 

Why would you reference variables in DOC GEN documents?

By referencing variables from a Checkbox App to a DOC GEN document such as Microsoft Word, you can create a bespoke document that is based on the end user's responses inside an Assessment.

For example, in a non-disclosure agreement (NDA) App, the details of both parties signing the contract captured inside a Checkbox App through a variable such as the signee's full name can then be referenced inside a DOC GEN document to be displayed when the document is generated within the App.

 

How can you reference variables inside DOC GEN documents?

You can reference variables from your App inside the DOC GEN document the same way you would reference a variable inside an App using double curly brackets. Learn more about variables. For example, by inserting {{FirstName}} in the document template, the value inputted in the firstName variable by the end user will be displayed when the document is generated through the Assessment.

Meta variables can also be referenced inside DOC GEN documents using double curly brackets. Learn more on meta variables in DOC GEN documents here.

 

Is there an easier way to reference variables inside DOC GEN documents?

Yes. You can use the Checkbox Word Add-in to connect your Checkbox Apps to Microsoft Word (DOC GEN document) to easily insert variables inside your Word document. This helps save time on going back and forth to reference variables inside your Checkbox App to your Word document.

The Checkbox Word Add-in also has an in-built validator which helps identify any syntax errors in the document, allowing you to upload an error-free DOC GEN document to your App.

 

Can referenced variables be styled and formatted?

Yes. Referenced variables may be styled (italics, bold, underline etc) and also formatted such as being inserted as part of a list (dot point and numbering etc).

Common styling of variables includes (but not limited to):

Styling Referenced Variable Example Display
Bold {{FirstName}} John
Italics {{FirstName}} John
Underline {{FirstName}} John
List (dotted)
  • {{FirstName}}
  • John
List (numbered)
  1. {{FirstName}}
  1. John


Please be advised that the styling of the variable in the Document will reflect the styling of the first bracket in the reference. For example {{FirstName}} will appear as bold text in the Document because the first bracket is bold. The styling of the remainder of the reference (i.e. the underline) will not impact the final styling.

Therefore, it is best practice to style the entirety of the referenced variable as shown in the table above.

 

Can Variables with Field Formatting be carried over?

Yes, however, to reference variables with  Field Formatting (e.g. number input variables, dates etc) you must include the text :formatted inside the variable reference. 

For Example, if you have set-up NUM15 to have the '$' prefix, and the user inputs 20,

  • {{NUM15}} will display 20 in the document as an output.

However, by adding ":formatted" next to the variable name inside the double curly brackets,

  • {{NUM15:formatted}} will display $20 in the document as an output.

This applies to all formatting - dates, percentages, decimals, prefixes etc. 

  

Limitations: 

  • By using a specific syntax, FILE variables can be used to display uploaded images with JPEG or PNG file types in DOC GEN documents. However, you cannot use standard FILE variables (e.g. {{FILE2}}) in DOC GEN documents or document builder to reference other files (e.g. .docx, .pdf, .xlsx, etc) uploaded by the end user.

 

 Related Articles: