The auto logic question is an invisible question type used for inserting or excluding content and formatting text in generated documents on a set of rules configured by the project's designer. These rules can refer to selections made in the question set, formulas, or values retrieved from data sources. As the auto logic question type is invisible it is only appropriate for controlling content document only, not the hiding and showing of items within the question set in Produce.
Rules are like conditions, stating that the content in question is relevant or irrelevant based on the stated rules. For example, a rule might be to include an extra paragraph in the document if the client is over the age of 55 years. In this example the rule would be ‘age is greater than 55’, and would be associated with the content to go in if the condition is met.
If the rules resolve to true the answer becomes active and content will be removed, included or formatted as configured. For example display all outstanding accounts in red and include an overdue notice. Multiple rules can be applied to a single piece of content catering for complex scenarios.
Selection or insertion placeholders can be used to mark content in the document that is to be removed if not needed or inserted from the content library where needed.
Rules are applied to the answers of an auto logic question, and are expressed by selecting what type of condition the rule is imposing, and where the information is coming from to determine if the rule is met.
Multiple rules can be grouped into ‘any of’ and ‘all of’ groups where they combine to determine if content will be included in the generated document.
Rules can be one of three types, which determine the behavior in how the rule resolves. The rule types are as follows:
An aggregate formula that references a set of data, either from a repeating section or page, or from a multi-row data source. For example, check if any ‘age’ field in the referenced data set is greater than 55.
You can define your rule to be met if any record in the referenced data matches the condition, or if all records must match.
For more information see Aggregate functions.
Answer value rules refer to another questions answer and compares it to a given value. For example, an ‘age’ text field answer is greater than 55. This is the most common rule type.
A formula is used to compare to a given value. For example, calculate age based on a date of birth, and check if it is greater than 55.
Fragment Outputs are used to reference a fragment's output to check if a comparison is true or not.
How to add an Auto Logic Question
1. From the toolbox, drag and drop an Auto Logic question onto a page, section column or tab.
2. Infiniti automatically adds an answer to the new question. Click on the answer to view its properties.
3. Give the Answer an appropriate name.
4. Use the Action drop-down to select the action that the Answer will perform when the configured rules are met. Insertion/Removal will determine if content is appropriate whereas Apply Style will format a selection of content.
5. If Apply Style has been selected choose and appropriate word style, note that only custom Word styles are available for selection, not base styles such as ‘Heading 1’.
6. Click on the Rules tab of the answer.
7. Select the rule type from the Type drop-down list. Refer to Rule Types above for more information on each type.
8. If you select the ‘Answer Value’ rule type, complete the following properties:
Select a question from the drop-down list to reference for the rule’s comparison. The list of answers updates to show each answer in the selected question.
Select the answer from the drop-drown list to reference for the rule’s comparison.
This property is only available if you are referencing a multi-row data source, or a question within a repeating page or repeating section.
This allows you to control whether the rule is met when any record referenced matches the comparison, or whether all records must match.
A quick method of creating Answer Value rules is to drag and drop the answer to be referenced onto the rules pane. When you drag and drop an answer, a default comparison type is selected and may require modification.
9. If you select the ‘Aggregate’ or ‘Formula’ rule types, enter a valid formula or aggregate formula in the Formula property.
10. Select a comparison type from the Comparison property, and enter a value in the provided textbox or drop-down list. This value will be compared with the answer, formula result or aggregate formula result.
11. Click Add to store your rule. You may use the Update and Remove buttons to modify your rules when needed.
12. Drag and drop any appropriate placeholders or content library items onto the answer.
If the Answer is a logic type any placeholders or content items belonging to the answer will be included and removed based on the result. Whereas for the style rule type the content within any placeholders will be set to the specified word style, if the rules resolve to true.
A list of all the auto logic rules that a question is referenced by can be retrieved by right-clicking a question in the question set and selecting the Find Dependencies option from the pop-up menu.
"All of" and "Any of" Rule Groups
For more complex situations, multiple rules may need to be grouped together. For example, the client needs to be male, over 55 and have 2 dependants in order for the content to be relevant. ‘All of’ and ‘Any of’ groups cater for this situation by processing multiple rules together.
In other words, an ‘all of’ group of rules is only satisfied if all of the rules in that group are met. If any one of them are not met, the answer is deemed irrelevant. Inversely, an ‘any of’ group needs only one of its rules to be met for the group of rules to be satisfied, making that answer relevant.
How to Create "All of" and "Any of" Rule Groups
1. In the Rules tab, click to create an ‘All of’ group or to create an ‘Any of’ group.
2. With the group selected add rules as described above.
3. Add additional groups as needed by the situation, groups can be nested inside one another as per the example below.
Auto Logic within Repeating Sections and Pages
When you place an auto logic question within a repeating page or repeating section, the rules are processed for each ‘record’ added by the end user in Produce. For example, consider the following repeating section:
The above repeating section is capturing information about a number of books, including title, author, price and discount. Let’s say there is a paragraph that must be included only if a discount applies, otherwise it’s to be excluded from the document – but this must happen for each book individually, as some will have discounts while others will not. The question set will include an auto logic question with the rule stating if the Discount answer must be greater than ‘0’ to include the ‘Special Price’ message.
In the following question set, the auto logic question is placed outside the repeating section that captures the data. In this case, the rule will not be applied to each book added in the repeating section, and the resulting document will appear as depicted below. Notice that the ‘Special Price’ message is displayed even for items with no discount.
In order to apply the rules of the auto logic to each book added in the repeating section, the auto logic question must be nested within the section itself. Typically it should go into the column it’s most relevant to, in this case the ‘Discount (%)’ column, however it will work in any column. When this is updated, the resulting document will appear as below:
This applies the same to repeating pages as it does to repeating sections, so the auto logic question should be nested within the repeating page for it to act on each record of data.
Auto Logic with Multi-Row Data Sources
Auto logic questions can also be set up to act on each record in a multi-row data source question, however unlike repeating sections or pages you cannot nest the auto logic simply by placing it within a data source question.
This can be achieved by setting the Parent Question property on the Repeat Parent tab of the auto logic question to reference the multi-row data source question.
By setting this property, the same behavior as described above for repeating sections and pages applies.
question type auto logic user formulae prompt address sign off data source datasource variable rich text group chart barcode autologic usergroup