Okay, so we go back here again.
We now need to make sure we press okay.
And we we check that this is all good.
It's all been created and it's there.
We go back over here.
And now it is time for us to go here and press this sign in with Google account.
This is where the magic happens.
Okay.
Let's do this.
Sign in with Google.
Up has popped a screen like so.
I'm going to use the same account.
It has to be the same account.
Amplify wants to access your Google account, allow you to see, edit, create and delete all your Google
Drive files and and so on.
Make sure you trust amplify.
So this is this is the the Oauth2 process.
And when I press allow Google is going to redirect back to the redirect URL that we configured just
a moment ago in the Google screens.
And that redirect URL takes it back to N810 again and it's expecting us.
It's waiting for this to happen.
And so then that happens.
Connection successful.
And can you see what I can see?
Yes you can.
You can see.
Green account connected.
We have just successfully completed a full OAuth two credentials flow.
Congratulations.
It would be a fair challenge to say to me why is that so hard?
Why is that so involved?
Why can't we just use an API key?
We're used to API keys and they're so simple.
And I guess it's important to have the context of of why this is such an involved process.
Because we have enabled great powers.
The idea of OAuth two is that it allows someone like us, supposing we were building a software product
called amplify.
Supposing amplify is something that we're later going to distribute to lots of people.
But in order for amplify to work, amplify needs to have access to the user's Google Drive.
Not to my Google Drive, but to the user's Google Drive.
So the user is going to be able to authenticate, and they're going to allow their Google Drive to be
operated on by my software called amplify.
Well, that's quite, quite an undertaking.
That's quite a lot of power that we're giving my software.
And it's important that the end user is aware of what's going on that I am amplify that Google knows
who I am and that it's okay for me amplify to have access to you the user's Google Drive.
And that's why there's hoops to jump through because this is an important security allowance.
We're getting rights to something big.
And that's why you have to say this is you have to identify, amplify to Google, make sure that Google
understands that and then go through these various hoops.
And the reason it was somewhat simpler when we were just doing it for the sheets before, is it?
Nan had already done a lot of that work in that case and and identified themselves to Google and acted
like the, the amplify in that case.
So, you know, this is one of those things you don't need to know this if you don't want.
But if you're thinking, why is that so hard?
Uh, keep in mind that this is a very powerful construct, and it allows for this very flexible ability
to give someone else, to give our application the ability to authenticate, to be allowed to use another
user's Google Drive.
In our case, it's quite a bit simpler because we are the user and it's our Google Drive, so it's not
actually such a big deal what we're doing, which is why it was relatively smooth.
Um, but that gives you the deeper insight into what OAuth two is all about.
Okay, now that we've done this, what can we actually use it for?
Let's let's let's do something with it okay.
So first of all I have just gone into Google Drive and I've created a folder called Amplify File Drop
in my drive amplify file drop.
This is of course at Drive.google.com.
If you're not familiar with Google Drive.
And uh there we go.
That folder has been created and now I'm going back into N810.
Let's, uh, let's escape out of here.
Let's go back into my project, into my first folder in here.
I should probably give it a better name and we'll create a new workflow.
Here we go inside the first folder.
What is this workflow going to do?
Well let's see.
Let's add a first step.
Let's go to Google Drive.
Here it is.
Google drive on changes involving a specific folder okay let's select that.
Here we go.
Credential.
It fills in automatically with the Google Drive account.
The thing that we did the mode the whole time is how often should it check in to see what's going on.
We'll say every minute, which is the default um, and uh, trigger on changes involving a specific
folder.
That's what we want.
Uh, folder will now select the folder.
And then we're going to say what to watch for okay.
For the folder I selected Amplify File.
Drop the folder that I just set up over here.
And now what to watch for.
Look at what we could do.
We are going to say when file is created uh file created right here.
Uh, and uh, let's just check this out.
This looks pretty good.
Um, we can just test an event, and it says no data could be found.
That seems good.
That's fine.
That's what we would expect.
Uh, and, uh, yeah, there's also the ability to have an option to select, uh, what file type it
looks for, but we will leave that without any properties.
Let's now, uh, escape out.
And here we have a Google file trigger.
All right.
Okay.
Next up we're going to connect this I'm going to connect it to a pushover notification.
Uh, push a message.
Uh, and the credential that we'll connect with will we'll need to, uh paste in our credentials from
pushover.
So select create New credential.
And remember we need to put the, the uh the token that goes into not the user one, but the one that
begins with the letter A that hopefully you have that to hand.
So I will then paste that in.
And then when I've done that sorry I'll come back here, I'm going to paste in my user key there, and
the message that I'm going to put in here is going to be a fixed message, which is going to be file
has arrived, exclamation mark, and make that a nice and high priority so that it makes a noise.
That's going to be great.
Okay.
I'm now going to put in my credentials that I'll do carefully to make sure I get them right.
The one that begins with an A is what I'll put in the credential.
The one begins with a you will go here and then I will save it.
Okay I did that.
And now let's go over here.
Let's go to Amplify File Drop.
And now let's make a new Google doc in here a new blank document that we will say wow.
And we will call it wow.
There we go.
It does it automatically.
And now if I go back here we should see that wow is there.
We come back here and we execute the workflow and Pam the workflow executed.
And I just got to push over.
My volume is turned off but I just got to push over.
Let me take a look at that notification.
Uh, just in case you don't believe me, here it is.
And it says file has arrived.
Uh, there it is.
So it appears to work nicely.
Uh, it is able to monitor for files arriving and send push notification.
Um, but of course, we actually want to see this happening live, in which case we would need to publish.
Okay, so I'm pressing.
I've saved it.
I'm pressing publish.
Publish this.
Off it goes.
Got it.
All right, back we come to the amplify file drop, and I guess we're going to we're going to duplicate
this.
Make a copy.
There it is.
And now the one minute countdown begins.
Up to a minute.
Uh, so, uh, I have to sit here talking to you, politely, hoping that it's not going to be too long.
Um, and meanwhile, I guess we can come back here to my workflow.
We can.
We can, um, go to executions.
We can see what's happening.
It's there.
It's running.
I don't have a pushover notification yet.
I hope you're excited.
I wonder, uh, okay, I think that's about a minute to go for me.
Uh, so.
So with any luck, we're going to have any minute now a notification come through.
We will see back.
We go over here.
That's good.
There we go.
Haha.
It happened.
We got the notification and there we go.
We get the succeeded.
There was some dead air there for a minute, but it was worth it.
It caught me off guard too.
Uh.
Very nice.
Uh, and this also has given us an opportunity to see the executions appearing here, so it was worth
the wait.
We got that through.
That's a success.
Uh, we have a deployed Google Drive trigger that's listening for new things arriving and is able to
send a push notification.