iFormBuilder Documents Common Questions
Table of Contents
- Error: Sorry, but you don't have the correct token. Please try again.
- Error: admin.formstack.com refused to connect
- Error: Error merging document (word/document.xml): Invalid document merge data, attempted math operation
- The Document Template contains a division by zero as a denominator
- Error: Error merging document (word/document.xml): Invalid merge data, one or more merge fields are accessing object data on a non-object
Error: Sorry, but you don't have the correct token. Please try again.
For those of you who were running into the below error when using Zerion Documents on a Chrome browser, the issue has been resolved as of 9/9/2020.
Error: admin.formstack.com refused to connect
If you are getting the "admin.formstack.com refused to connect" error while using the Chrome browser in Incognito mode, you will need to configure the browser to allow Third-Party Cookies.
Error: Error merging document (word/document.xml): Invalid document merge data, attempted invalid math operation.
The math operations performed contained incorrect data types. Typically, when attempting to subtract two values, at least one cannot be parsed as a numeric value.
For example:
{$number1 - $number2}
With values:
$number1 = ‘5’
$number2 = ‘test’
What action can I take?
Ensure all values that are passed into merge fields, that will be used in a mathematical operation, are numeric.
Copy calculations from an open-sourced word processor like TextEdit rather than from a program like Word to eliminate possible extra HTML properties.
Use the ‘intval’ or ‘floatval’ modifier to ensure the value is an integer or decimal (floating point) value.
Example:
{$number1|intval - $number2|intval}
The Document Template contains a division by zero as a denominator
The document contains a division operation, but the denominator is zero (0).
What action can I take?
Confirm that the data source never sends 0, empty, or null for any merge field that is used as the denominator for a division operation.
Use the |intval or |floatval modifiers to ensure the value is a numeric type.
Example:
{if $denominator|intval > 0}
{$numerator|intval / $denominator|intval}
{else}
0
{/if}
Error: Error merging document (word/document.xml): Invalid merge data, one or more merge fields are accessing object data on a non-object.
An illegal array is offset with a string passed instead of an object in post data. An example of this could look like this:
{$Test[‘value’]} or {$Test.value}
With values:
$Test = ‘string’;
What action can I take?
Ensure all merge fields that will be used are passed in with the correct data structure. Use is_array to check that it is an array before accessing the value.
Example:
{if is_array($MergeField)}
Populate data if array
{else}
Do something else if not array
{/if}
You can also convert the null value that is being sent over to an empty array by adding this line at the top of your document for each array:
{if !is_array($ExampleArray1)}{$ExampleArray1 = [“”]}{/if}
For more examples, you can check out FormStack's Help Center article here.
Comments
0 comments
Please sign in to leave a comment.