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

A transcript of our tutorial video, ensuring you can find exactly what you need, when you need it.

You can search this page to find the relevant time-stamp in the video. Also, this text can be used as part of the tutorial search feature.

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