When building or testing out a form you may run into issues that may seem inexplicable. A section might not show up when you are expecting it to, or a paragraph might not read as you are expecting.
To debug the template, usually you can just note where in the assembled document the error is located and match that with your template to figure out what is going on. However with more complex templates the location of the error might not be quite so obvious. To make finding errors easier we have a template debugging function.
Note that Assembly_Debug only works for conditions in Long IFs adhering to the following syntax:
Field_Name operator 'value'
Conditions following the alternative syntax:
([Field_Name] operator 'value')
will always appear as errors. We recommend the former syntax for ease of use with the debugger.
Also note that Assembly_Debug does not run checks on any Short-IF fields, clause references or any other Word-native fields or switches.
How to implement the debugger
To activate the function, simply include a hidden text field on the form with the field name Assembly_Debug and set its default value to true.
Important! Make sure you set this to false once you are done debugging!
Save the form and reopen the record of the submission you had the error with. Cycle through the pages of the form and submit. You will receive an assembled document as you would expect in a regular submission as well as a version of the assembled document in debug mode. The debugged document will have "_Debug" at the end of the file name
How do I make sense of the debugged document?
Fields that contain data from the form and IF conditions that have passed will be highlighted green. IF conditions which have not passed or are not able to be read by the debugger will be highlighted red. All content that would be shown or hidden by Long IFs will be visible, and this allows you to see what would or would not be showing regardless of what data was actually submitted in your debugging run.
All conditional logic will include a short description of the values of the fields used in the condition, whether the values satisfy the condition or not.
How do I fix my template?
There is a section completely missing from the debugged output
This indicates that the field name used in the condition did not match any fields in the submitted data.
This is usually due to a typo, so double check that the field name in your template matches the field name in your form. If they do match, the field was likely on a page that was not accessed by the user at any point. If the form page was hidden by logic, consider enclosing that template section in the same logic. If the page was visible, but just skipped by the user, you might consider making the field required, or disallowing click on breadcrumb for all of the pages on your form.
The condition was highlighted red and the content did not show up in my original assembled document
For a section you were not expecting to appear, don't worry! This is just letting you know that the section was hidden as intended.
For a section you were expecting to appear based on an option selected in the form, check that the condition in the IFStart field matches the value that follows it. Either the value you are checking against in the template is incorrect, the option selected in the form does not have the correct value, or you have inadvertently used a different field name in your condition.
For checkbox groups you will have to check the associated record to find the values, as the debugger will always return a debug value of (checkBox=true)
The condition was highlighted red but the content did show up in my original assembled document
This happens in two cases.
Case 1 - The syntax for your template condition is not recognised by the debugger. As noted above, conditions following the alternative syntax: ([Field_Name] operator 'value') will always appear as errors. This error will always be accompanied by a value description of 'can't find field in File'.
Case 2 - The template condition used the Contains operator. Contains is not recognised by the debugger. If this is checking for an option in a checkbox group, we suggest using the Like operator instead. Note that when converting from Contains to Like, you should replace the asterisks with percentage symbols, for example:
{ MERGEFIELD IFStart:A checkBoxGroup Contains '*Option1*' }
Would be updated to:
{ MERGEFIELD IFStart:A checkBoxGroup Like '%Option1%' }
If you are using 'Contains' for a single-value field like a dropdown list, radio or text field, do not swap it out for 'Like'.
If you are having trouble debugging your template feel free to submit a support request at the top of the page.
Comments
0 comments
Article is closed for comments.