WEBVTT

00:00.080 --> 00:00.480
Okay.

00:00.520 --> 00:02.160
We're next going to take it one step further.

00:02.160 --> 00:06.520
Let's go back to my project to my first folder and make a new workflow.

00:06.520 --> 00:07.800
Create new workflow.

00:08.080 --> 00:08.480
All right.

00:08.520 --> 00:14.120
The first step is going to be again the same thing the Google Drive trigger.

00:14.120 --> 00:18.680
We want to be triggered when a file arrives on changes for a particular folder.

00:19.120 --> 00:23.560
And we're using that credential every minute changes to a specific folder.

00:23.600 --> 00:26.280
We're going to select the amplify one there again.

00:26.280 --> 00:26.920
And again.

00:26.920 --> 00:30.400
It's going to be when a file is created in the watched folder.

00:30.520 --> 00:31.560
Let's do that.

00:31.600 --> 00:36.200
Okay so we've selected Amplify File Drop as the folder that it's looking at.

00:36.400 --> 00:38.600
So this trigger is now set up.

00:38.600 --> 00:43.000
And now the next thing I'm going to add is another Google Drive node.

00:43.000 --> 00:45.920
This time the node operation will be an action.

00:45.920 --> 00:48.840
It's going to be to download a file.

00:49.200 --> 00:50.160
And here it is.

00:50.200 --> 00:51.280
And we now need to set it up.

00:51.280 --> 00:54.760
So the file it downloads is the file we're being notified about.

00:54.800 --> 00:55.200
Okay.

00:55.240 --> 00:59.480
So the file we have to select, we're going to have it be an expression.

00:59.720 --> 01:02.030
And we're going to want it to be by ID.

01:02.270 --> 01:07.070
And so this expression has to give the file ID which needs to be collected.

01:07.070 --> 01:10.990
And now we don't know the format that the data comes in there.

01:11.030 --> 01:16.430
Although we can get a hint because we can look back at what we had before and see what the data looked

01:16.430 --> 01:16.870
like.

01:16.990 --> 01:24.750
So if we save this for a second and X out and come back to my project, back into my first folder to

01:24.790 --> 01:31.310
the previous workflow, and we open up the push notification, we can see over here on the left what

01:31.310 --> 01:37.710
kind of data comes in, and use this as our as our key to find out what kind of thing we want.

01:37.750 --> 01:42.070
And we can see that there is in fact a field called ID here.

01:42.070 --> 01:45.470
And so that gives us a good sense of what it might be.

01:45.790 --> 01:49.790
Uh, let's just check if there's anything else that might be what we're looking for.

01:50.030 --> 01:51.430
It doesn't look like it.

01:51.470 --> 01:57.550
It doesn't look like there's a file ID, so it looks like we can assume that ID is probably what we're

01:57.590 --> 01:58.270
after.

01:58.270 --> 02:01.110
So now with that, do you know what we have to do next?

02:01.190 --> 02:02.270
Well, you guessed it.

02:02.310 --> 02:06.910
We come back here, we come back into my first folder, we come to our new workflow.

02:06.910 --> 02:07.790
Here it is.

02:07.990 --> 02:14.470
We open this up and we're going to select an expression.

02:14.470 --> 02:20.910
And that expression is going to have double curlies like that dollar json.id.

02:21.630 --> 02:29.950
And uh this this is what we want to select the incoming ID, that is the file that we want to download.

02:30.150 --> 02:32.190
And for now we're not going to add another node.

02:32.190 --> 02:33.230
We're going to leave it at this.

02:33.270 --> 02:37.510
We'll save it and we will come back over here.

02:37.830 --> 02:40.150
And we will now duplicate this.

02:40.150 --> 02:41.670
Make a copy of this.

02:41.910 --> 02:43.270
Come back here.

02:43.590 --> 02:45.910
And now execute this.

02:46.190 --> 02:48.630
And then we'll need to see what happens.

02:48.630 --> 02:49.990
It ran successfully.

02:49.990 --> 02:52.550
Let's open this up and check this out.

02:52.550 --> 02:55.030
We've got a file that we've downloaded.

02:55.030 --> 02:57.470
We've got some data okay.

02:57.510 --> 02:59.500
Next we press plus again.

02:59.700 --> 03:09.020
And now we're going to to create a node here called extract from file convert binary data to JSON.

03:09.220 --> 03:10.060
How about that.

03:10.100 --> 03:13.820
It appears to be something that will do exactly what we want at this point.

03:14.060 --> 03:19.980
Uh, and here we have the different kinds of data that this is able to read in as it is.

03:20.300 --> 03:26.100
And at this point, we can we can choose, uh, how we want to, to come into this, and we can have

03:26.100 --> 03:31.540
it so that it will take a PDF file and extract text from that PDF.

03:31.780 --> 03:33.700
And that is what we're going to do at this point.

03:33.700 --> 03:36.140
I'm going to have a PDF file.

03:36.140 --> 03:38.980
And I'm going to add in an extract from PDF.

03:39.460 --> 03:40.740
Uh where will it find it.

03:40.780 --> 03:43.740
We're going to say it's going to be in in data.

03:44.100 --> 03:48.780
Um, and this this will be the binary data that it's going to bring in.

03:49.100 --> 03:51.660
And, uh, this this is what we need to do.

03:51.700 --> 03:53.540
We'll just check the options.

03:53.540 --> 03:54.980
That all sounds fine.

03:55.220 --> 03:58.780
Uh, next up, let's go back here now.

03:58.900 --> 04:04.580
We need to make ourselves a PDF and then drop that in the amplify folder and see what happens.

04:04.620 --> 04:06.860
And so next up I brought up Microsoft word.

04:06.860 --> 04:09.300
But you can use any application really.

04:09.300 --> 04:12.780
Anything you can think of that might allow you to put some text in there.

04:12.780 --> 04:17.860
And I'm going to say this is a very important message.

04:18.540 --> 04:20.340
There we go a very important message.

04:20.340 --> 04:26.060
Now, the way that you convert this to PDF, there are so many ways you go file export, you can print

04:26.060 --> 04:27.420
and then print as PDF.

04:27.460 --> 04:30.620
You can just do save file save, which I'll do right now.

04:31.300 --> 04:33.060
This is a very important message.

04:33.220 --> 04:40.660
And I can now just say in the file format I can pick here and say file format PDF.

04:40.860 --> 04:44.580
And then I can say message dot PDF.

04:46.380 --> 04:47.740
I don't think I need to do the PDF.

04:47.740 --> 04:48.460
I can just do that.

04:48.460 --> 04:53.180
And it's now saving that as a PDF file on my computer.

04:53.220 --> 04:53.780
Okay.

04:53.940 --> 04:59.530
Now we go over to Amplify File Drop right here I've got my finder window open on the on the side.

04:59.530 --> 05:01.290
I've got my message PDF.

05:01.530 --> 05:04.130
I'm going to drag and drop it in here.

05:04.290 --> 05:05.290
It's uploading.

05:05.330 --> 05:07.170
It's their message PDF.

05:07.290 --> 05:11.730
I come back here, I execute the workflow and let's see what happens.

05:13.330 --> 05:13.970
Okay.

05:14.250 --> 05:14.890
It all ran.

05:14.890 --> 05:16.770
Let's double click to see what we've got here.

05:17.170 --> 05:20.570
And it read it all in and we've got text.

05:20.610 --> 05:27.210
This is a very important message pulled from the PDF parsed by N810.

05:27.370 --> 05:29.210
Can you believe how easy this is.

05:29.450 --> 05:31.010
All right let's press on.

05:31.050 --> 05:32.450
I'm really enjoying myself here.

05:32.530 --> 05:32.890
All right.

05:32.890 --> 05:36.410
So the next thing we do is we come back here, we add on another node here.

05:36.450 --> 05:38.330
You'll never guess what node this is going to be.

05:38.370 --> 05:41.090
It is of course going to be a pushover node.

05:41.330 --> 05:42.370
There it is.

05:42.410 --> 05:44.290
We're going to push a message.

05:44.530 --> 05:50.810
Uh, and, uh, it has remembered my my pushover account, but I have to paste back in my user key,

05:50.970 --> 05:51.970
which I will do.

05:52.090 --> 05:56.360
But the other thing I have to do is put in the message, and of course, it's going to be an been expression,

05:56.360 --> 05:59.920
and I hardly need to tell you at this point what it's going to be.

05:59.920 --> 06:04.880
But you look over here on the left, it is a little bit more involved, but we can just simply drag

06:04.880 --> 06:09.320
and drop text and put it in their JSON text.

06:09.360 --> 06:12.760
This is a very important message is what will come in this case.

06:12.920 --> 06:14.400
Uh, and that seems good.

06:14.400 --> 06:18.320
I'm just going to put in my user key there and then save this node.

06:18.360 --> 06:18.840
Okay.

06:18.840 --> 06:21.320
And obviously when I say save the node I just mean press escape.

06:21.320 --> 06:23.400
I also tend to press save anyway.

06:23.400 --> 06:25.600
So it does actually save the whole the whole workflow.

06:25.720 --> 06:26.400
All right.

06:26.480 --> 06:32.320
So with that we go back over to Amplify File Drop I find my message I'm going to I'm going to drag and

06:32.320 --> 06:34.400
drop the same file a second time.

06:34.640 --> 06:37.040
In it goes uh keep both files.

06:37.040 --> 06:39.480
So it's going to, going to have another version of it.

06:39.480 --> 06:40.000
There it is.

06:40.000 --> 06:42.480
Message one back to my workflow.

06:42.680 --> 06:44.080
Execute workflow.

06:47.520 --> 06:50.040
And push message just came through here.

06:50.040 --> 06:53.800
It has this is a very important message.

06:54.080 --> 06:58.680
Ha ha ha I love it, I love it.

06:58.680 --> 07:04.160
And, uh, as it would happen, I was confused for a second because that was not the only push notification

07:04.160 --> 07:04.680
I got.

07:04.720 --> 07:06.240
You probably had the same experience.

07:06.240 --> 07:11.280
I also got file has arrived because the production, the other one is also running.

07:11.440 --> 07:14.240
Uh, and so it also woke up when it saw this.

07:14.240 --> 07:16.440
So, uh, that's cool.

07:16.440 --> 07:21.920
So just to revisit, just to recap, take a look at this and let's quickly walk through what just happened.

07:21.920 --> 07:28.640
And so to recap the workflow, we have a Google Drive trigger that is woken up anytime it pulls every

07:28.640 --> 07:29.120
minute.

07:29.120 --> 07:33.720
And if it finds a new file has gone into our setup, Google Drive.

07:33.760 --> 07:40.360
Thanks to our OAuth two credentials, it will then notify the next node along, which is a download

07:40.360 --> 07:41.200
file node.

07:41.200 --> 07:44.440
This node doesn't actually download the file, it just has an ID in it.

07:44.480 --> 07:48.560
We pluck out that ID with an expression, and then we download that file.

07:48.560 --> 07:50.920
That then goes to the extract from PDF.

07:50.960 --> 07:53.920
And you'll see here in comes a data object.

07:54.030 --> 08:00.030
Out goes a actually JSON that represents that file and it includes the text.

08:00.070 --> 08:04.550
This is a very important message, which is the stuff that we then notify.

08:04.870 --> 08:07.270
And we can do it one more time.

08:07.270 --> 08:09.470
Just, just just for the fun of it, okay.

08:09.510 --> 08:13.230
And one more time we come over here to the file drop.

08:13.470 --> 08:19.910
We come to the I'm going over to my, my my finder I'm dragging message in here.

08:19.910 --> 08:21.950
I'm going to say keep both files.

08:21.950 --> 08:23.990
I'm going to do that back over here.

08:24.230 --> 08:29.790
Execute the workflow checks this and there's the push notification.

08:29.790 --> 08:31.030
And maybe we'll get a second one in.

08:31.310 --> 08:34.390
There's the second one that's Rob production flow as well.

08:34.390 --> 08:36.350
So I've now got two notifications.

08:36.510 --> 08:40.150
Uh the first notification says this is a very important message.

08:40.150 --> 08:42.390
And the second one says file has arrived.

08:42.550 --> 08:43.670
Very cool.

08:43.990 --> 08:45.030
It works.

08:45.230 --> 08:48.790
Uh, I know it's a simple thing, but it's kind of satisfying.

08:48.830 --> 08:53.150
It's kind of fun and the to do for you if you want to try and get creative.

08:53.230 --> 08:59.430
We've been we've used a PDF flow and you'll see that the extract from file here, it can work with with

08:59.430 --> 09:01.310
with PDF extract from PDF.

09:01.350 --> 09:04.310
It can also extract these other kinds of things as well.

09:04.750 --> 09:07.430
But of course you have to choose in advance which one you set.

09:07.430 --> 09:12.910
So what you could have is one of those if instructions you could put in here an if and you can look

09:12.910 --> 09:19.310
at the different type of file and pass it to the right kind of extraction based on what the file kind

09:19.350 --> 09:19.910
is.

09:19.910 --> 09:24.870
So you can you can put something in there that looks at the different type of file coming in, has an

09:24.910 --> 09:27.470
if statement based on that file type.

09:27.630 --> 09:33.390
Uh, it would then based on this Mime type, if it's if it's application PDF then it then it routes

09:33.390 --> 09:35.310
it to PDF extraction.

09:35.350 --> 09:36.910
Otherwise you could extract something else.

09:36.910 --> 09:38.870
That would be a cool extra feature.

09:38.870 --> 09:43.870
And that way you could drag and drop different file types into your amplify file drop.

09:43.870 --> 09:47.990
And it will wake up and parse them and message you whatever they are.

09:48.030 --> 09:49.310
But have fun with this.

09:49.310 --> 09:53.430
This is some great integrations that we have now put in place.
