00:00:05:15 - 00:00:07:01
Variables can be created to
00:00:07:01 - 00:00:11:06
accept data
in specified date and time formats
00:00:11:09 - 00:00:14:28
rather than simply
just allowing the free input of text.
00:00:15:00 - 00:00:17:21
When doing this, it's important
to specify the exact
00:00:17:21 - 00:00:21:20
required format for those inputs.
00:00:21:23 - 00:00:23:16
When working with an entire field
00:00:23:16 - 00:00:26:17
in your MegaEdit product such as the one
we've got on the screen at the moment.
00:00:26:24 - 00:00:28:21
This is quite simple.
00:00:28:21 - 00:00:31:14
So you see that we've specified it
as a date format
00:00:31:14 - 00:00:35:14
and then we have the ability to specify
the formats that date is going to take.
00:00:35:17 - 00:00:39:27
And then when you look at it on the form,
it appears as a date picker.
00:00:40:00 - 00:00:44:15
Similar process
with a time field as specified as time.
00:00:44:18 - 00:00:48:00
We can put in some basic specifications
of what time it will allow.
00:00:48:02 - 00:00:49:10
Then it appears on our form.
00:00:49:10 - 00:00:52:29
But what happens
if we need to apply that exact formatting
00:00:53:02 - 00:00:58:01
when the date and time
are input as variables within one field?
00:00:58:04 - 00:01:01:13
So we still want the same functionality
of the form
00:01:01:13 - 00:01:04:17
entries like this,
but they're no longer separate fields.
00:01:04:17 - 00:01:08:28
They're now included as variables
in one solitary field.
00:01:09:01 - 00:01:14:13
So this tutorial will walk us through the
process of configuring and applying that.
00:01:14:15 - 00:01:17:20
Now this tutorial assumes
some prior knowledge in the configuration
00:01:17:20 - 00:01:24:02
of fields and variables
in the Infigo form builder.
00:01:24:04 - 00:01:25:19
So this is my starting point.
00:01:25:19 - 00:01:27:25
So you see we've done a bit of work
previously.
00:01:27:25 - 00:01:30:05
Following instructions from other Infigo.
00:01:30:05 - 00:01:33:15
Academy tutorials create and configure
a couple of basic
00:01:33:15 - 00:01:36:22
variables within the script config.
00:01:36:24 - 00:01:40:27
There's something like this
with not much specification at the moment
00:01:40:29 - 00:01:45:01
and then once done, base
those variables into a single text
00:01:45:01 - 00:01:51:01
field on your MegaEdit canvas.
00:01:51:03 - 00:01:54:17
Now as mentioned,
I have a fully configured date and time
00:01:54:24 - 00:01:58:10
field set here, so two individual fields.
00:01:58:13 - 00:02:03:09
The easiest way to actually obtain the
correct format of tag for your variables
00:02:03:11 - 00:02:07:09
is to utilize
an entire field dedicated to the date
00:02:07:16 - 00:02:11:21
or time formats.
00:02:11:23 - 00:02:14:08
If I click on the date field,
for example, and starts
00:02:14:08 - 00:02:22:22
changing this formatting
of our required date,
00:02:22:25 - 00:02:24:13
as you change the date format,
00:02:24:13 - 00:02:29:04
a field tag will be created
detailing that required format.
00:02:29:06 - 00:02:33:06
Now what we want to do is copy down
this information as will input this later
00:02:33:06 - 00:02:37:16
on into our variable.
00:02:37:18 - 00:02:38:09
We can repeat that
00:02:38:09 - 00:02:41:09
same process with a dedicated time field.
00:02:41:10 - 00:02:45:06
So if I click on my time field here,
00:02:45:09 - 00:02:48:09
change the format of the time
that is shown in this field
00:02:48:10 - 00:02:55:01
in order to create a relevant field tag.
00:02:55:04 - 00:02:57:20
And again, we just want to copy down
that field tag for later
00:02:57:20 - 00:03:05:23
use as we're going to utilize it
within our variable.
00:03:05:25 - 00:03:06:21
So with that information
00:03:06:21 - 00:03:10:18
done, I'm
going to navigate to our script config.
00:03:10:20 - 00:03:13:08
There's a couple of modifications
we need to make in here
00:03:13:08 - 00:03:18:00
to allow them
to utilize date and time formats.
00:03:18:02 - 00:03:18:22
Starting off with
00:03:18:22 - 00:03:22:15
the date example and the date variable.
00:03:22:17 - 00:03:26:03
The first thing we want to do is to modify
the input line
00:03:26:05 - 00:03:29:04
so mine is currently specified
as text field.
00:03:29:04 - 00:03:33:04
I want this to be a date field.
00:03:33:07 - 00:03:35:07
This will enable
the use of these additional
00:03:35:07 - 00:03:38:14
formatting tags.
00:03:38:16 - 00:03:40:19
And then we want to add a new line
00:03:40:19 - 00:03:45:15
to our variable configuration,
which is named tags.
00:03:45:18 - 00:03:48:01
So what we want to do here
is input the date field
00:03:48:01 - 00:03:51:29
tag information that we copied down,
ensuring the correct format.
00:03:51:29 - 00:03:54:10
So we'll see this in a moment.
00:03:54:10 - 00:03:58:05
So I need to make sure that
if I'm adding a new line this last line
00:03:58:05 - 00:04:02:07
of the configuration of that variable
does need a comma at the end,
00:04:02:09 - 00:04:03:17
then a new line.
00:04:03:17 - 00:04:10:05
And then we want to format this as tags
00:04:10:07 - 00:04:11:25
and then whatever we copy down
00:04:11:25 - 00:04:15:22
from our actual MegaEdit product.
00:04:15:25 - 00:04:17:16
That's what we're going to input in here.
00:04:17:16 - 00:04:21:28
So this is just one example.
00:04:22:01 - 00:04:24:23
Moving on to the time
variable, it's a very similar process.
00:04:24:23 - 00:04:30:03
We first need to modify the input line
and this is going to be a time field.
00:04:30:05 - 00:04:36:03
And again, this will enable the use
of these additional formatting text.
00:04:36:05 - 00:04:37:23
And again,
we're going to repeat the process
00:04:37:23 - 00:04:39:19
and put the additional tags line.
00:04:39:19 - 00:04:43:14
So first,
put the comma on the previous line,
00:04:43:16 - 00:04:48:02
then start creating our tags on.
00:04:48:05 - 00:04:49:21
So there's another example.
00:04:49:21 - 00:04:53:15
We'll go ahead and save that
just to make sure that it's utilized
00:04:53:18 - 00:04:57:06
and double check that it's not come up
with an error in the JSON format.
00:04:57:08 - 00:04:58:13
So there's no error come up.
00:04:58:13 - 00:05:02:21
So we know that is successful.
We've been able to save.
00:05:02:23 - 00:05:06:05
Now going
to go back to my MegaEdit product
00:05:06:08 - 00:05:17:10
and refresh it.
00:05:17:12 - 00:05:18:17
And we can see on our form
00:05:18:17 - 00:05:21:17
now that we have those variables
in action.
00:05:21:18 - 00:05:25:08
So I'm just going to delete
the actual date field and time fields
00:05:25:08 - 00:05:32:19
just so we can actually focus
on the ones that we've just made.
00:05:32:21 - 00:05:34:19
So you'll see within our variable field,
00:05:34:19 - 00:05:38:08
I have a date
tag example and our time tag example.
00:05:38:11 - 00:05:42:04
When I start making changes to these,
it will update the contents
00:05:42:10 - 00:05:46:19
of that one single field
with the two bits of variable information.