A Deeper Dive into Invent Logic
On this page, we'll walk through some of the available options when defining logic in your variable product templates using Infigo Invent for InDesign.
Invent Logic is a powerful feature within Infigo Invent that allows for the creation of highly versatile product templates. It enables the dynamic adjustment of aesthetics, layout, and functionality based on selections made in the customer-facing form. For example, changing certain fields on the form can trigger actions such as filling in dead space, hiding variables, and moving or resizing fields on the canvas. This flexibility allows for the creation of customizable and user-friendly product experiences.
This page contains information on configuring and utilising:
- The "Setup Logic" page, allowing you to define complex IF statements within your product templates to alter both the customer-facing form and the fields on the canvas itself.
- Group Spread behaviour, allowing you to automatically shift fields to fill the gap left by unused (and hidden) fields.
- Variable suppression, allowing you to hide static text you wish to associate with one of your variables. For example with static text of "T:" preceding a telephone number, we can use variable suppression to ensure the "T:" is hidden when no telephone number is input into the variable.
- Parent variables, allowing you to control the visibility of variables on the user-facing form based on the value of other variables.
This page was built to go hand-in-hand with our May 2024 webinar, "A Deeper Dive into Invent Logic". Once this has been held, you will be able to rewatch on-demand, right over there >>>
Sample Products for Invent Logic
We have some additional resources to help you understand Invent's logic capabilities.
Below, you will find links to:
- Invent Logic | Reference Product - This has a separate section for each significant area of logic in Invent. Use this to learn how to apply and use each of these features.
- Invent Logic | Practical Product Example - In this case a business card, to show you how combining these capabilities can result in high levels of customisation in your product templates.
Spread Behaviour
Spread behaviour within Invent allows us to control the behaviour of a set of grouped fields.
Behaviour we can control includes:
- Automatically shifting fields to fill gaps left by other hidden fields.
- Automatically hiding fields based on the visibility of a "Master" field.
- Automatically hiding fields if its contents is empty.
Creating a group of fields is easily done using the following steps:
- Multi-select the fields you wish to group in InDesign
- Right click on the selected fields and click "Group"
- It is recommended to assign relevant naming to the group and contained fields within the "Layers" tab in InDesign. This is not a requirement, but will make future configuration much simpler.
- Set the individual fields to be controlled by Infigo Invent (within the Invent "Properties" tab)
- Set the Group to be controlled by Infigo Invent (within the Invent "Properties" tab).
With the group selected and enabled in Invent, the "Properties" tab will show configuration options for that group. This consists of:
- Selection of a group "Master" | This can be set as one field or as no fields. It allows you to define whether one field's visibility will impact the visibility of all other fields. If this is set to "No Group Master" then all fields are equal.
- Specification of the "Spread Behaviour" | Define how fields will move relative to fields that are hidden around them. For example "Spread Vertically" will ensure only vertical shifting of fields is done, they will not move horizontally to fill freed up space.
- Specification of field order | Allows you to control the order of importance of fields, with lower rankin fields moving towards them to fill space when hidden.
Let's take a look at a few examples of different configurations.
Examples of Spread Behaviour
No Grouping
Let's start off with a control example. This gif shows the behaviour if our sample fields are not grouped when the mex file is created.
As we can see, all fields act completely independently. Hiding any fields using the form has no impact on the surrounding fields.
No Master | No Spread
Even though the fields are now grouped, this configuration sees the same as an ungrouped set. The fields will have no impact on each other.
Master Set (field 2) | No Spread
This example sees field 2 set as the group master.
We see that fields other than this will still act independently, however any change in visibility of the master field will impact all other fields in the group.
Here, for example, we see hiding field 2 also hides all other fields.
No Master | Spread Vertically
Vertical spread behaviour will ensure that only upwards and downwards movement of fields are possible. This should not be used if any horizontal movement is required.
In this example, we see that hiding field 1 results in a vertical movement of field 3 which sits below it.
In addition, 1 is higher in the field order, meaning lower fields will move to fill the gap when 1 is hidden. The same is not seen of field 3. It sits lower in the order than field 1, which means field 1 does not move down to fill the gap if 3 is hidden.
No Master | Spread Horizontally
Horizontal spread behaviour will ensure that only left and right movement of fields are possible. This should not be used if any vertical movement is required.
In this example, we see that hiding field 3 results in a horizontal movement of field 4 which sits to the right of it.
In addition, 3 is higher in the field order, meaning lower fields will move to fill the gap when 3 is hidden. The same is not seen of field 4. It sits lower in the order than field 3, which means field 3 does not move right to fill the gap if 4 is hidden.
No Master | Spread Horizontally and Vertically
This setting ensures that both horizontal and vertical movement of fields within a group are possible when another field in the group is hidden.
This movement works in a zig-zag fashion and relates to the field order. So in this example, where the field order is 1,2,3,4, we can see lower order fields move left and upwards to fill any gaps.
No Master | Spread Horizontally and Vertically | Changed Field Order
In this example, we've reversed the order of the fields from 1,2,3,4 to 4,3,2,1.
The change in behaviour shows that the higher numbers are now being prioritised, with smaller numbers moving to fill the gap when they are hidden. Due to the positioning of the fields, they are now moving in a right and downward direction.
Hide if empty
This check box, able to be applied to fields individually, ensures that if a valid field on the customer-facing form is empty, the field on the canvas will also be hidden.
This could then have the knock-on effects we've seen above, such as moving other fields to fill the gap.
Variable Suppression
A useful tool for ensuring that static text associated with your variable matches the visibility of the variable itself.
For example, if we have a telephone number in a business card formatted as:
"T: 0115475625"
The telephone number is a variable entered by the user, however we want to make sure that if no telephone number is entered, the related "T:" static text is also hidden.
Variable suppression is perfect for this purpose. You can find the option to enable it within the Invent Properties tab when a field is selected and enabled.
No Variable Suppression
Let's start with a control. This field is set to have no variable suppression.
As a result, whenever a variable is emptied, there is no knock-on effect to surrounding static text.
Left Variable Suppression
Left variable suppression ensures that static text to the left of the chosen variable is suppressed when the variable is emptied in the customer-facing form.
All text to the left of the variable will be hidden, either until the beginning of the text frame is reached, or if another variable is reached.
Right Variable Suppression
Right variable suppression ensures that static text to the right of the chosen variable is suppressed when the variable is emptied in the customer-facing form.
All text to the right of the variable will be hidden, either until the end of the text frame is reached, or if another variable is reached.
Full Variable Suppression
Full Variable Suppression is a functionality within Infigo designed to handle elements such as static text separators, pipes (|
) for example, around variables when the variables are empty. It ensures that the formatting remains clean and logical by removing unnecessary separators.
Example:
Consider the setup:
<Variable 1> | <Variable 2> | <Variable 3>
- Left Suppression: Removes static text to the left of a variable if the variable is empty.
- Right Suppression: Removes static text to the right of a variable if the variable is empty.
- Full Suppression: Handles the removal of separators for multiple variables simultaneously to ensure proper formatting.
How Full Variable Suppression Works:
If Variable 1 is empty:
- The first pipe (
|
) is removed to prevent an empty pipe at the beginning. <Variable 2> | <Variable 3>
If Variable 2 is empty:
- Ensures there is still a pipe separating Variable 1 and Variable 3 by removing the unnecessary pipe.
<Variable 1> | <Variable 3>
If Variable 3 is empty:
- The last pipe (
|
) is removed to prevent the sequence from ending with a pipe. <Variable 1> | <Variable 2>
This ensures that the remaining variables are properly separated without leading, trailing, or double separators, maintaining a clean and professional appearance in the output.
Parent Variables
Parent variables are a great tool allowing you to associate the visibility of a variable in the user-facing form with the value of another variable.
For example, you may have a variable which is only visible when a separate boolean check box is ticked, or if a certain value in a dropdown is selected.
Parent variables are defined by first selecting the child variable (the one you wish to control the visibility of). Simply identify that a parent variable is needed, select the parent variable, then specify the conditions under which the child variable will be shown or hidden.
Parent Variable Examples
Here, we see two examples of parent and child variables, with the parent variables demonstrating the ability to use different variable types as the driver for child variable visibility.
In example 1, we see a boolean directly controlling the visibility of a child variable on the form.
In example 2, we see similar behaviour, however it is the selection of value(s) in a dropdown which are driving the visibility of the child variable.
Setup Logic Window
The main bulk of the capabilities and versatility surrounding logic in Invent comes when we start to look at the logic builder, found within the "Setup Logic" button of Invent's "Variables" tab.
This functionality allows you to generate complex IF statements to control a vast array of actions based on one or multiple conditions. The capabilities of this section include (but are not limited to):
- Controlling the visibility of variables on the user-facing form
- Controlling the size and position of fields on the canvas
- Controlling the visibility of fields on the canvas
- Changing variable values in the user-facing form
- Changing the formatting of fields on the canvas
Each IF statement can have multiple actions, multiple conditions and can cover a range of alternate conditions using Else conditions.
Let's explore some of the capabilities of the Setup Logic screen.
Setup Logic | General Capabilities
Single Conditions and Actions
Let's start off with a simple one, we'll create an IF statement which contains a single condition and a single resulting action.
The condition defines when the IF statement comes into effect, whilst the action defines what the IF statement will change.
In this example, we're providing the user with a dropdown to select between two brands, Infigo and Infigo Academy. Our condition will be the selection of one of these dropdown options, such as:
if dropdown value equals "Infigo"
Next we define our action. Our action will be to select a particular logo image to display in an image field when the condition is met. So, for example:
Display Infigo logo
We can't consider our IF statement complete until we've closed it out using an Else. In this case that means defining what the alternate action should be. So, what image should be displayed if the dropdown value is not "Infigo". So:
Otherwise display the Infigo Academy logo
This rounds off our IF statement, with the system now having a solution for every possible scenerio.
Our final statement is essentially:
if the dropdown equals "Infigo" then display the Infigo logo, otherwise display the Infigo Academy logo.
Multiple Conditions and Actions
This example takes the IF statement one step further, where we now have multiple conditions and multiple actions making up the statement.
Our end result is that if a certain combination of dropdown options are selected, actions will be triggered making changes to fields on the canvas.
In our example, two conditions are required for the IF statement to be triggered. The "Logo" variable must be set to "Infigo" and the "Sub-brand" variable must be set to "Academy". Whilst in this case we have set an and between the two conditions, meaning both need to be met in order to trigger it, an or input is also possible, meaning that either condition would have to be met. This starts our statement:
if Logo equals "Infigo" and Sub-brand equals "Academy"
We then have multiple actions that will be carried out if the IF statement is triggered. In our example:
- The image frame containing the logo will be set as visible
- The image contained in the frame is set to a certain image
- The background colour of another frame is set to a defined colour
As with the previous example, we need to complete the IF statement by defining an ELSE, which covers any alternate scenario. In this case we have again specified multiple actions:
- The image frame containing the logo is set to hide
- The background colour is set as white
So our final statement is:
if Logo equals "Infigo" and Sub-brand equals "Academy" then show the relevant logo and change the background colour. In any other scenario, hide the logo and change the background colour to white.
Else and Else If
Often, with additional variables comes additional potential configurations of options. One way to accommodate these is to utilise Else If and Else. These options allow you to define numerous potential configurations of variables in the same If statement.
In our example we have three dropdown variables, allowing the selection of "Logo", "Sub-brand" and "Logo Colour". Multiple options are available for each of these variables, so we have an increasing number of potential configurations we need to consider. Here, those variations include:
- Hiding the logo field and customer-facing form variables if no logo is selected.
- Changing to the correct logo within an image frame, based on the selection of "Sub-brand" and "Logo Colour".
Due to these requirements, we have specified our initial IF statement, as seen in previous steps. However, we then specify an Else If. This gives you the ability to define a completely new set of conditions and actions to cover a different scenario. Multiple Else If's can be defined in one statement to cover multiple scenarios.
We still need to round of the If statement with an Else. Instead of defining an Else If for the final variation, specify the required actions within the Else area. This will ensure that all options are covered.
Setup Logic | Targeted Capabilities
Variable Actions | Set Value / Show / Hide
The Setup Logic window gives you the ability to control both the value and the visibility of your variables.
Show and hide options allow you to control the visibility of variables show to the end user on the user-facing form.
Setting a variable's value has wider reaching capabilities. Values can be set for variables shown on the customer-facing form, or for variables which are driven in the background and are not displayed to the customer.
In our example, we've created our If statement so that one variable changes visibility based on the value of another.
In addition, we have another variable which has a changing value based on the value of another variable.
Note: As with many of the areas that can be controlled via if statement, this can also be accomplished by other means within Infigo Invent. The power of the Invent's logic features comes when there are complex conditions and actions that need to be adhered to. To learn of alternate ways to achieve this under simplier conditions, check out the Infigo Academy.
Field Actions | Show / Hide
Next, we'll start to take a look at field actions. Using If statements, we're able to perform a sweeping range of modifications to fields present on the canvas.
Let's start off with arguable the most basic and most crucial, show and hide.
As an action within your If statements, you're able to specify Show or Hide for any enabled field within your Invent template.
Note: You may find that the default InDesign naming for these fields is quite hard to decipher within the Setup Logic window. We recommend renaming your fields using InDesigns "Layers" window. These names will also be passed to Invent.
In our example, we're simply showing and hiding a field based on a boolean field present in our customer-facing form.
Field Actions | Set Size
This feature allows you to change the size of a field on your canvas based on variable inputs / selections.
Resizing options include:
- Changing field height, width or both.
- Specification of "Absolute" size, i.e. specify the final field size.
- Specification of "Relative" size, i.e. a specified change in value from the current size.
- "Match Field", mimic the size of another specified field present on the canvas.
In our simple example shown to the right, we have a dropdown selection which causes our field to switch between matching the field size of the other two fields on the canvas. No specific size needs to be input, as it simply replicates the other field sizes.
Field Actions | Set Position
This feature allows you to change the position of a field on your canvas based on variable inputs / selections.
Repositioning options include:
- Changing field X position, Y position or both.
- Specification of "Absolute" position, i.e. specify the final field position.
- Specification of "Relative" position, i.e. a specified change in value from the current position.
- "Match Field", mimic the position of another specified field present on the canvas.
In our simple example shown to the right, we have a dropdown selection which is controlling the absolute Y position of the field on the canvas. Each dropdown selection is linked to a specific Y coordinate via the crafted IF statement, meaning the same position will always be provided when a variable value is selected.
In our simple example shown to the right, we have a dropdown selection which causes our field to switch between matching the field size of the other two fields on the canvas. No specific size needs to be input, as it simply replicates the other field sizes.
Field Actions | Set Image
Applicable to image fields only. This function (as we've seen from previous parts of this page) allows you to display a specific image in the selected field.
The image can be sources either directly from a resource set, i.e. you can choose one specific image. Alternatively, you can select an image based on the value of a variable, if that variable has a Clipart resource associated with it.
The example we've used here shows a simple example of this. We have a simple if statement where an image is being changed based on the value of a variable in our customer-facing form.
Note: As with many of the areas that can be controlled via if statement, this can also be accomplished by other means within Infigo Invent. The power of the Invent's logic features comes when there are complex conditions and actions that need to be adhered to. To learn of alternate ways to achieve this under simplier conditions, check out the Infigo Academy.
Field Actions | Set Background Colour
This option allows you to directly control the background colour of the selected field via an if statement. This is applicable to image, text and barcode fields.
Colours to change to can be defined manually (via colour picker, CMYK or RGB format), via defined resource (directly pick a colour from defined colour resource sets) or by utilising defined colour type variables.
In our example, we're simply changing the background colour of an empty image field via a simple if statement.
Note: As with many of the areas that can be controlled via if statement, this can also be accomplished by other means within Infigo Invent. The power of the Invent's logic features comes when there are complex conditions and actions that need to be adhered to. To learn of alternate ways to achieve this under simplier conditions, check out the Infigo Academy.
Field Actions | Set Text
This feature gives you another way to set the text present within a text field on your canvas.
Text can be manually specified in this way, alternatively can be linked to either specified text resource sets or to variables.
In our example, we're keeping things simple by entering manual text, however the displayed text is changed based on the condition of the IF statement.
Field Actions | Set Font (and other font formatting)
This option allows you to define, as part of your IF statements, changes to the utilised font, font colour or font size within a text field.
Font size and font colour can both be manually specified, alternatively font colour can be linked to colour resource sets or variables, whilst font size can be linked to a variable.
The font can either be selected from one of your font resource sets, or can be selected via a variable.
In our example, we will create a scenario there are two font themes, selected via a checkbox. In the IF statement, each condition contains multiple actions affecting the font, colour and size.
Field Actions | Set Text Mode
The Set Text Mode capability in Infigo Logic allows users to control formatting capabilities of a text field on the canvas, from within the customer-facing Invent form. This feature accesses various text options, such as:
- Fixed: Determines whether a text field is editable by non-admin users. If set to true, the text field is not editable; if set to false, it is editable.
- No Rich Formatting: Disables rich text formatting options from the field's pop-up window.
- No Formatting: Hides formatting options for the text field within the field's pop-up window.
These settings can be controlled through an If statement in Invent Logic, which dynamically changes the text mode based on user interactions with the form.