HomeGuidesRecipesAPI
HomeGuidesAPILog In

The logic question is an invisible question type used as a central node to perform calculations, similar to a variable question, and control question conditions that are repetitive or relevant questions cant encapsulate alone; like dynamically calculated values and complex requirements for insertion, exclusion, and formatting of certain content and text into generated documents.

Usage

The only output for a Logic question answer is a true/false (boolean) value, not an integer or string. If you plan to use a formula for one of these outputs then the variable question might be a better fit and are generally easier for this use case.

The answer question for a logic question has a unique 'Rules' tab in the inspector panel, this is where all the rules go. Rules can refer to selections made in questions, formulas, or values retrieved from data sources.

If you select the ‘Aggregate’ or ‘Formula’ rule types, enter a valid formula in the Formula property.

A list of all the 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.

Question 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.

Repeating question

This property is only available if you are referencing a multi-row data source, or a question within a repeating page or repeating section. 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

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.

Answer Properties

PropertiesDescription
Document PreparationSelection 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.
UsageRules are applied to the answers to 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 the content will be included in the generated document.
Rule TypesRules can be one of four types, which determine the behavior in how the rule resolves. The rule types are as follows:
AggregateAn 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 ValueAnswer value rules refer to another question's 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.
FormulaA 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 OutputFragment Outputs are used to reference a fragment's output to check if a comparison is true or not.

Rule Groups

For more complex situations, multiple rules may need to be grouped together. From left to right of the rule controls; copy, paste, move selected up, move selected down, new 'all of', new 'any of', and switch selected group between 'all of' and 'any of'

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.