Show details for Setting up basic variable logic in Invent | IV_010

Setting up basic variable logic in Invent | IV_010

In this tutorial, we will look at Invent's ability to create variable logic. This allows you to create and perform more complex and inteligent behaviour within your MegaEdit product. Variable Logic is essentially a collection of Rules, with each rule being made up of a series of Conditions and Actions. This article will run you through the high level process of creating some simple logic conditions and actions to demonstrate how this can be used in real life examples.

Tutorial Video Transcript

00:00:13:11 - 00:00:14:15
In this tutorial, we'll

00:00:14:15 - 00:00:17:17
look at Invent ability
to create variable logic.

00:00:18:11 - 00:00:21:06
So this allows you to create and perform
more complex

00:00:21:06 - 00:00:24:07
and intelligent behavior
within your MegaEdit product.

00:00:24:29 - 00:00:29:07
Variable logic is essentially a collection
of rules, with each rule

00:00:29:07 - 00:00:31:26
being made up of a series of conditions
and actions.

00:00:33:09 - 00:00:36:02
This video will run you
through the high level process

00:00:36:02 - 00:00:40:00
of creating some simple logic, conditions
and actions to demonstrate

00:00:40:01 - 00:00:41:22
how this can be used in real life.

00:00:41:22 - 00:00:44:07
Examples.

00:00:45:27 - 00:00:47:02
Now, before we begin this.

00:00:47:02 - 00:00:48:01
Process, we do need.

00:00:48:01 - 00:00:51:15
To spend a bit of time
understanding the initial product setup.

00:00:51:15 - 00:00:53:02
I have here.

00:00:53:06 - 00:00:58:19
So our initial Invent template is a very
simple setup consisting of functionality

00:00:58:19 - 00:01:01:26
that we've covered in previous tutorials
in this series.

00:01:02:25 - 00:01:05:25
So this consists of a few resource groups

00:01:05:25 - 00:01:08:24
which we're going to be utilizing
primarily these bottom three.

00:01:09:15 - 00:01:10:18
So we have a clip.

00:01:10:18 - 00:01:13:04
Art group
which controls this. Graphic down in.

00:01:13:04 - 00:01:17:27
The bottom left of our business card,
we have a logo set,

00:01:17:27 - 00:01:19:01
which is just two different.

00:01:19:01 - 00:01:21:08
Variations of this logo shown. Here.

00:01:22:14 - 00:01:24:22
And we have background color sets.

00:01:24:22 - 00:01:27:17
So these are color pickers
to colors, to be precise,

00:01:28:06 - 00:01:32:21
which will control the background of this
frame here.

00:01:32:21 - 00:01:36:03
So the same frame
that's utilizing this clip art.

00:01:36:03 - 00:01:37:04
It will.

00:01:37:04 - 00:01:39:27
Control.
The background color of that frame.

00:01:40:04 - 00:01:42:00
And that's essentially acting
as a background.

00:01:42:00 - 00:01:43:07
Color for this particular.

00:01:43:07 - 00:01:45:13
Document.

00:01:50:25 - 00:01:51:09
Built

00:01:51:09 - 00:01:55:00
from those resources,
we have three variables available.

00:01:55:18 - 00:01:58:13
One of them is a logo set variable.

00:01:58:14 - 00:02:01:22
So that's which of the logos we're using.

00:02:02:24 - 00:02:04:06
We have a graphic set.

00:02:04:06 - 00:02:05:19
That's the.

00:02:05:21 - 00:02:07:13
Graphic that we're using.

00:02:07:13 - 00:02:10:11
And the background color set,
which is controlling the background

00:02:10:11 - 00:02:13:05
color of this frame.

00:02:13:13 - 00:02:15:13
Now do note that each of these variables.

00:02:15:13 - 00:02:17:29
Is set to a dropdown.

00:02:17:29 - 00:02:19:13
As it stands at the moment.

00:02:19:13 - 00:02:23:16
At the time of recording this video,
setting up logic on

00:02:23:16 - 00:02:26:12
your forms is best done with.

00:02:27:04 - 00:02:28:18
Dropdown. Entries.

00:02:29:28 - 00:02:31:18
This may change as time progresses.

00:02:31:18 - 00:02:33:09
However, at the moment, please
make sure you're

00:02:33:09 - 00:02:37:19
utilizing dropdown variable types
if you want to.

00:02:37:19 - 00:02:41:09
Utilize form logic.

00:02:42:15 - 00:02:44:26
Now to actually define
some logic on our form.

00:02:44:27 - 00:02:50:23
If we go to the variables
tab and click on set up logic,

00:02:50:23 - 00:02:52:21
that will give you a separate window
which looks.

00:02:52:21 - 00:02:55:25
Something like this.

00:02:57:21 - 00:02:58:26
We start off by clicking

00:02:58:26 - 00:03:01:08
the add logic button on the top right
hand side

00:03:02:00 - 00:03:06:17
that will and add a new entry of which
we can have a maximum of 50 of these,

00:03:07:02 - 00:03:09:21
where we can specify a name,
a description.

00:03:10:01 - 00:03:11:23
And then set up our actual.

00:03:11:23 - 00:03:15:07
Rules for that logic statement.

00:03:21:06 - 00:03:24:17
So first we'll specify a name
and what we're essentially trying

00:03:24:17 - 00:03:30:06
to get this logic statement to do is
to automatically change the logo that's.

00:03:30:06 - 00:03:31:11
Being utilized.

00:03:31:11 - 00:03:33:15
Based on the. Background color selection.

00:03:34:28 - 00:03:35:16
So we can give it an.

00:03:35:16 - 00:03:38:04
Appropriate name.

00:03:40:20 - 00:03:44:00
Optionally, we can give it a description

00:03:53:01 - 00:03:53:26
and then we can start.

00:03:53:26 - 00:03:56:11
Building our rules.

00:03:56:14 - 00:03:59:10
So each rule requires first a condition

00:03:59:23 - 00:04:04:16
and there's a maximum of ten
assigned to a single rule.

00:04:05:22 - 00:04:08:21
So I can click add condition
down on the right hand side

00:04:09:07 - 00:04:11:25
and then you just building up
the required statement.

00:04:12:17 - 00:04:15:27
So it's an IF statement that we're building
and the options we have.

00:04:15:27 - 00:04:17:21
Available are.

00:04:17:21 - 00:04:20:00
Always or never.

00:04:20:00 - 00:04:23:14
And then optionally,
we have a list of all different variables

00:04:23:14 - 00:04:27:16
that we have specified.

00:04:27:16 - 00:04:29:22
So we're basing this
around the background color.

00:04:30:02 - 00:04:33:20
So if I say if one of our variables
called background color

00:04:34:12 - 00:04:39:03
and then we have equals or not equals,

00:04:39:03 - 00:04:42:16
then we have a specification of the values
available.

00:04:42:25 - 00:04:46:01
For that particular variable,
which in this case are.

00:04:46:01 - 00:04:47:19
Navy or white.

00:04:48:22 - 00:04:49:24
So I could say that if the

00:04:49:24 - 00:04:52:00
background color equals navy

00:04:54:28 - 00:04:56:28
and then we want an associated action.

00:04:58:27 - 00:04:59:19
So I can say add.

00:04:59:19 - 00:05:03:09
Action,
and then we want to dictate what happens

00:05:03:17 - 00:05:06:28
if that condition is met.

00:05:07:24 - 00:05:12:16
So we want to change the logo set
and we want to set the value of.

00:05:12:17 - 00:05:15:19
That variable. To be.

00:05:15:23 - 00:05:18:00
The white version in this case.

00:05:18:00 - 00:05:20:21
So what that means
is that if the Navy background color

00:05:20:21 - 00:05:23:26
is selected, the logo.

00:05:23:26 - 00:05:27:28
Will change to the white version
of the logo.

00:05:33:29 - 00:05:36:08
Notice
that we can have multiple conditions

00:05:36:08 - 00:05:39:28
or multiple actions per rule.

00:05:40:15 - 00:05:43:02
We also need to define an else.

00:05:43:04 - 00:05:45:06
Statement for this rule as well.

00:05:45:06 - 00:05:47:14
So what happens
if this condition isn't met?

00:05:48:17 - 00:05:51:14
So I can say add else

00:05:52:00 - 00:05:54:06
that will give us a second set of actions.

00:05:54:13 - 00:05:59:13
So these are the actions that will happen
if this condition or multiple conditions

00:05:59:13 - 00:06:03:01
that we've defined are not met.

00:06:03:15 - 00:06:05:16
So else add action

00:06:07:12 - 00:06:08:06
logo set.

00:06:08:06 - 00:06:09:14
Variable

00:06:10:26 - 00:06:12:17
set value

00:06:12:17 - 00:06:17:00
to the other variable
or the other entry we've got.

00:06:17:00 - 00:06:23:22
Within that variable.

00:06:23:22 - 00:06:25:23
And that's our statement completed.

00:06:25:23 - 00:06:29:09
Just to show you this before we move
on, you'll notice that when I'm

00:06:29:09 - 00:06:33:09
setting my actions, we have a list of both
the available variables

00:06:33:22 - 00:06:37:11
and the fields
that we have set to dynamic.

00:06:38:16 - 00:06:40:29
So notice
if I select one of the fields, my

00:06:41:07 - 00:06:44:18
a available actions
become a little bit different.

00:06:45:06 - 00:06:48:01
So we have the ability to show and hide
a certain field.

00:06:48:22 - 00:06:51:19
We have the ability to directly change
the background color,

00:06:51:19 - 00:06:54:05
which we could have utilized
in this particular rule as well.

00:06:54:26 - 00:06:57:02
Change the size at the position or.

00:06:57:02 - 00:06:59:15
Change the image that's being utilized.

00:06:59:15 - 00:07:01:14
So the way in which you approach this.

00:07:01:14 - 00:07:03:04
Is completely up to you.

00:07:04:17 - 00:07:06:03
In this case, we're going to

00:07:06:03 - 00:07:08:03
stick with changing one of our variables.

00:07:09:10 - 00:07:10:29
As that's nice and easy based on our.

00:07:10:29 - 00:07:13:05
Setup.

00:07:16:10 - 00:07:18:13
With that defined, I can click on Save

00:07:19:13 - 00:07:23:18
and then going to go ahead and export
the MEX file and.

00:07:23:18 - 00:07:25:28
Re-Import that into our MegaEdit.

00:07:25:28 - 00:07:27:03
Product.

00:07:27:08 - 00:07:31:03
So with our product loaded in MegaEdits,
we can actually test the behavior.

00:07:31:03 - 00:07:32:23
That we've just set. Up.

00:07:32:23 - 00:07:35:07
So if we recall, we'd specified it

00:07:35:07 - 00:07:38:21
so that when we change the background
color, the logo selection changes.

00:07:39:24 - 00:07:43:19
So if I change the background color,
you can see that the chosen logo.

00:07:43:26 - 00:07:46:06
Has. Switched.

00:07:49:09 - 00:07:51:09
Now, in this case, we still have that.

00:07:51:09 - 00:07:52:19
Logo set variable.

00:07:52:19 - 00:07:56:22
Being displayed on our form
as it's been automatically changed.

00:07:57:07 - 00:07:59:18
Hypothetically, we could get rid. Of that.

00:08:00:10 - 00:08:03:27
Variable on the actual form,
so the variable will still be

00:08:04:02 - 00:08:05:11
present in the background

00:08:05:11 - 00:08:07:25
and it will still be being driven
by the background color.

00:08:08:08 - 00:08:10:14
But we don't have to
make it present on the form.

00:08:11:26 - 00:08:13:15
Just to remind you where to do that.

00:08:13:15 - 00:08:17:06
Same as with a previous video.

00:08:17:06 - 00:08:23:18
If we go to variables and set up forms,
we could get rid of that.

00:08:23:18 - 00:08:25:09
Logo set variable on.

00:08:25:09 - 00:08:27:28
The form itself.

00:08:31:27 - 00:08:33:23
So that's a very simple overview

00:08:33:23 - 00:08:36:24
of setting up rules
and setting up logic on your form.

00:08:37:07 - 00:08:41:01
Of course, you can accomplish
much more complicated actions than that.

00:08:42:14 - 00:08:43:25
Hopefully that gives you an overview.

00:08:43:25 - 00:08:46:12
We'll try to cover
some more detailed functionality.

00:08:46:20 - 00:08:50:12
In future videos on this topic.

 

Incomplete
Step by Step Guide

Setting up basic variable logic in Invent

In this tutorial, we will look at Invent's ability to create variable logic.

This allows you to create and perform more complex and inteligent behaviour within your MegaEdit product. Variable Logic is essentially a collection of Rules, with each rule being made up of a series of Conditions and Actions. This article will run you through the high level process of creating some simple logic conditions and actions to demonstrate how this can be used in real life examples.

Creation Date: Dec 15, 2022
Created By: Sam Webster

1. Understand the initial example setup

Our initial Invent template is a simple setup consisting of functionality described in previous tutorials.

This consists of:

  • 2 Resource Sets

    • 1 Colour Set with some defined brand colours

    • 1 Image Set with two logo options

  • 2 Variables

    • 1 dropdown controlling the Colour Set selection - visible on the form

    • 1 dropdown controlling the logo selection - not visible on the form

  • 2 image fields on the canvas

    • 1 with the background linked to the colour selection variable

    • 1 with the image linked to the logo variable.

Our next step is to add some logic which changes the logo selection based on the background colour selected.

Understand the initial example setup

2. Click Variables

Click Variables

3. Click Setup Logic

Click Setup Logic

4. On the logic screen, click Add Logic

On the logic screen, click Add Logic

5. Logic pop up screen

In order to use Variable Logic you need to start by creating a Rule.

You need to specify a name for your Rule and optionally a description so you can explain what this specific rule is doing.

Then each rule requires first a Condition (with a maximum of 10 assigned to a single Rule) and then an Action (with a maximum of 50 assigned to a single Rule) if that Condition is met.

A single rule can have multiple else if statements, each containing their own Conditions and Actions so that if one Condition is not met, you can check for many more.

You can also specify a 'catch all' else statement at the end of your Rule if you wish that has no Condition but only an Action and will always run IF no previous Conditions you have setup are met.

When creating a Rule it needs contain at least one 'if' statement. Within that if statement you will configure your Conditions and Actions and if those Conditions are not met it will do nothing.

What you can do though is setup multiple 'if' statements so that if one Condition is not met you can check for another and so on. In this situation you should create your first 'if' statement and then create subsequent 'else if' statements underneath.

The order of these statements is important because the logic will first check the 'if' statement and only if that is not met, will it then check each of the following 'else if' statements until one returns true.

Finally you can create an 'else' statement at the end that is used as a 'catch all'. This is there to ensure that the Rule you have setup with always do something even if all the Conditions you have created are not met. For the 'else' statement you do not create a Condition, only an Action as it will always run IF any of the previous 'if' and 'else if' statements have not been met (returned false).

Logic pop up screen

6. Specify a logic statement name

Specify a logic statement name

7. Click Add Condition

Conditions are used in the Variable Logic Rules to determine when an Action should be triggered. A Condition can be set to run Always, Never OR based on a specific Variable. You can also include multiple Conditions within the same statement and set it up so that ALL conditions should be met, some conditions should be met or just one.

When assigning a Condition to a Variable you can then create statements that will check that Variable if it contains, does not contain, is equal to etc. and then specify a value as the check criteria.

Click Add Condition

8. Select the target of your condition

This could be one of your existing variables, or can be an Always or Never condition.

Select the target of your condition

9. In our example, we will select our background variable

Once selected, additional options will appear allowing us to specify the state of that selection.

In our example, we will select our background variable

10. Complete the condition

In our example, our logic trigger condition will be:

Logo Side Background | Equals | Navy

So:

Variable | Status | Variable Option

Complete the condition

11. Click Add Action

An Action is something that you want to happen when a Condition that you have setup is met. Actions can be assigned to both Variables and Fields and we support 3 types of action that can be assigned to a Variable or Field:

  • Set Value - You can specify a new value for that specific Variable or Field

  • Show - You can set that Variable or Field to be shown

  • Hide - You can set that Variable or Field to be hidden

Click Add Action

12. Select the target of your action

Select the target of your action

13. Select an Action's behaviour and result

Select an Action's behaviour and result

14. Click Add else or Add else if to add alternative actions

Click Add else or Add else if to add alternative actions

15. Click Add Action

Click Add Action

16. Complete else action statements

Complete else action statements

17. Review our logic and click Save

So in our example, the specified logic will result in the following behaviour:

If the background colour is set to Navy then we will show the white version of the logo.

If the background colour is anything else, then we will show the colour version of the logo.

To finish and confirm this logic, click Save.

Review our logic and click Save

18. Export the MEX Invent template file

Export the MEX Invent template file

19. Import your MEX file into your MegaEdit product

See previous tutorials for further information on how to do this.

Import your MEX file into your MegaEdit product

20. Launch your MegaEdit product editor

Launch your MegaEdit product editor

21. Click the colour variable

Your product will load in a default condition, with your variable(s) visible to the right of the screen.

Click the colour variable

22. Select an alternate colour

Select an alternate colour

23. The background colour will change, with the logic also causing the logo selection to update

The background colour will change, with the logic also causing the logo selection to update
Alternate Search Terms