WEBVTT

00:00.120 --> 00:02.640
So this isn't a no code course.

00:02.640 --> 00:09.240
It's a low code course, which means occasionally we will take a little step in the direction of coding.

00:09.240 --> 00:12.560
And one of the ways is through expressions.

00:12.560 --> 00:14.080
And you're going to love expressions.

00:14.080 --> 00:20.200
Expressions give you this ability to be much more flexible about about how your workflow runs.

00:20.200 --> 00:23.080
And it allows you to to have a lot more power in what goes on.

00:23.520 --> 00:29.680
Basically, rather than using some fixed value for doing something, you're able to determine dynamically

00:29.720 --> 00:30.920
what should be used.

00:30.960 --> 00:33.360
It's like a formula in Excel instead of the value.

00:33.360 --> 00:36.080
And and honestly, they're not complicated.

00:36.080 --> 00:41.640
They can look intimidating at first, a bit like an Excel formula, but once you get the idea of them,

00:41.640 --> 00:46.800
and once you've got a few in your arsenal that you can just reuse in different places, then you will

00:46.800 --> 00:48.800
find this to be to be super easy.

00:48.800 --> 00:52.480
So let's look at some of them and and then we will use them in earnest.

00:52.520 --> 00:57.080
If this seems very theoretical, but we are going to put this into practice in our integrations coming

00:57.080 --> 00:57.440
right up.

00:57.440 --> 01:02.660
So there are a bunch of fields in NHSN where you'll see a little toggle above the field that can switch

01:02.660 --> 01:07.620
between being fixed and being an expression, and that is where we will be using them today.

01:07.620 --> 01:12.740
And that's where you can say, okay, I want this, this to always be the number three, or I want to

01:12.740 --> 01:17.220
give you a little bit of, of a formula for calculating what this value should be.

01:17.620 --> 01:22.940
And expressions are surrounded in double curlies, two, two sets of curly braces like that.

01:22.940 --> 01:26.060
So you get used to seeing these double curlies everywhere.

01:26.300 --> 01:28.140
And so you should immediately click.

01:28.140 --> 01:34.140
And when you see that, you think, okay, it's an expression and there's a there's something to know,

01:34.180 --> 01:41.860
which is just, just a nice little shortcut that if you want in any of your expressions to access whatever

01:41.860 --> 01:48.380
is the incoming data from the node before where you are, then you use this particular thing here,

01:48.420 --> 01:50.860
dollar sign and then the word JSON.

01:50.900 --> 01:56.980
That means I want to have access to the incoming data in JSON format.

01:57.140 --> 02:04.320
So a lot about these expressions comes down to navigating your way through a JSON object.

02:04.320 --> 02:10.000
You remember that JSON is key value pairs, and that the value might itself be an object with key value

02:10.000 --> 02:10.560
pairs.

02:10.680 --> 02:15.560
So often you're saying something like, okay, I've got a person, I want to get the first name, or

02:15.560 --> 02:20.280
I want to get the address and the country of the address of the person.

02:20.280 --> 02:24.200
So you're often like drilling down into these JSON objects.

02:24.200 --> 02:28.120
And the way you do that is with a period a dot.

02:28.400 --> 02:34.080
So you can say if we if we have an object like this same person thing that we just looked at before,

02:34.200 --> 02:36.800
it's got a name, an age and an address.

02:36.800 --> 02:40.720
And the address has a street, a city and a country.

02:41.000 --> 02:47.960
Then if you did JSON dot name, you'd be plucking out Alice from this structure.

02:48.120 --> 02:55.680
If you did JSON dot address, you're plucking out that that little section under address dot city.

02:56.080 --> 02:59.200
Then you're plucking New York out of that structure.

02:59.600 --> 03:07.250
So look in purple at the JSON name and the Jason address city and then reference the yellow box above

03:07.250 --> 03:14.410
it and just check you fully understand how those dots allow you to drill into the JSON and pluck out

03:14.450 --> 03:20.450
the information that we need from that data, and that is really giving you all the perspective you

03:20.450 --> 03:27.330
need on data structures in JSON, and on how you write expressions and use dots to drill into them to

03:27.370 --> 03:29.370
retrieve specific data items.

03:29.410 --> 03:34.210
Now, at various points, we will be doing things that are just slightly more fiddly with expressions

03:34.210 --> 03:34.770
than JSON.

03:34.770 --> 03:36.170
I want to show you what they look like.

03:36.290 --> 03:40.010
You do not need to understand these right now, just just so that you're aware of it.

03:40.050 --> 03:42.330
We'll be doing much more of this in due course.

03:42.330 --> 03:46.490
And if you do know about this, if you do know about JSON, then then just it's worth knowing this.

03:46.490 --> 03:49.610
So a couple of expressions we will use at some point.

03:49.610 --> 03:56.330
So I showed you that dollar JSON gives you access to the data that's incoming into this node that we're

03:56.330 --> 03:57.450
working on right now.

03:57.450 --> 04:01.630
But what if you wanted to look at some data from a prior node somewhere else.

04:01.630 --> 04:04.550
Well, there's there's a trick to doing that instead of dollar.

04:04.550 --> 04:05.230
Jason.

04:05.270 --> 04:11.990
You do dollar node and then in square brackets as it shows right here, you put the name of that node.

04:11.990 --> 04:17.070
And that allows you to grab data from any previous node in your workflow.

04:17.270 --> 04:21.910
And that means that that you can write an expression which is able to combine information from across

04:21.910 --> 04:22.950
the whole workflow.

04:23.230 --> 04:30.470
And then one other little thing to know is that what if you want to to take some JSON and turn it into

04:30.470 --> 04:33.590
a string, turn it into text, for example.

04:33.630 --> 04:37.950
Because because you want to pass it to an LM or something like that, then it's worth knowing there

04:37.950 --> 04:39.710
is this thing called Stringify.

04:39.950 --> 04:46.430
You put JSON and block capitals, dot stringify, and then you can pass in anything in those brackets

04:46.430 --> 04:51.070
inside those brackets and it will turn that into text.

04:51.070 --> 04:58.590
So json.stringify and then perhaps dollar JSON, which is the incoming data will turn the incoming data

04:58.590 --> 05:00.150
into plain text.

05:00.630 --> 05:04.610
So if you're if you're new to this, that might not make complete sense.

05:04.610 --> 05:05.410
In which case, don't worry.

05:05.450 --> 05:08.890
Just just just, uh, just look at remember this vaguely.

05:08.930 --> 05:10.210
Get some intuition.

05:10.210 --> 05:11.810
We'll see it in practice.

05:11.810 --> 05:15.490
It's when you actually experiment with this and build it for real that you see it coming together.

05:15.490 --> 05:18.850
And if you are familiar with the JSON, then these are two expressions to know about.

05:18.850 --> 05:23.730
And as a general principle, I would say you never need to memorize anything like this.

05:23.770 --> 05:25.130
Don't don't memorize these things.

05:25.130 --> 05:30.050
As long as you have some understanding of it, you can always look up at the time how to do a particular

05:30.050 --> 05:30.770
expression.

05:30.770 --> 05:36.890
Great documentation in Na ten or ChatGPT or Claude will tell you exactly what expression that you need,

05:36.930 --> 05:40.530
but it's good to recognize what it looks like when it's when it's the right answer.

05:40.770 --> 05:45.330
Okay, that's it for both JSON for data and expressions.

05:45.370 --> 05:49.650
At least that's enough for now for us to build a bunch more integrations.

05:49.650 --> 05:54.370
But before we go and do that, I do want to sort of introduce the topic of the integrations that we're

05:54.370 --> 05:56.210
going to do today, and they're going to be great fun.

05:56.210 --> 06:03.310
So often the stickiest part of building an integration with a third party is called authentication,

06:03.310 --> 06:06.950
which is convincing the third party that you are who you say you are.

06:07.230 --> 06:09.590
And there are a number of different approaches for this.

06:09.590 --> 06:11.950
And we're going to be using all of these approaches.

06:12.190 --> 06:17.390
And here they are in in order of increasing complexity.

06:17.590 --> 06:21.350
Uh, the and of course, there are many different ways to authenticate with third parties.

06:21.350 --> 06:24.550
These are the ones that we'll be using through NHSN.

06:24.870 --> 06:27.630
The first of them is the easiest of them all.

06:27.630 --> 06:33.710
And it's when you have an API key, you've established an API key with the third party, and you provide

06:33.710 --> 06:35.470
that API key in N810.

06:35.470 --> 06:36.670
And then you have the connection.

06:36.670 --> 06:40.990
And that's what we did with with the open router and with with OpenAI.

06:41.310 --> 06:43.150
And what we will do with many.

06:43.190 --> 06:44.670
It's super easy.

06:44.870 --> 06:46.510
An API key is like a password.

06:46.510 --> 06:47.670
It's like a secret.

06:47.830 --> 06:52.630
And once you've put it in there and you've shown it, it appears green in n810, you know you've got

06:52.630 --> 06:53.510
the connection.

06:53.510 --> 06:54.350
All is good.

06:54.510 --> 06:56.950
Uh, if only if only it was.

06:56.990 --> 06:58.630
It was that easy for everything.

06:58.630 --> 07:06.200
So obviously the time that it's harder is when you don't just want to have, like one bridge to a third

07:06.200 --> 07:06.800
party.

07:06.840 --> 07:13.240
Like, I want to be linked to OpenAI and have an OpenAI key, but rather you want to be able to to to

07:13.280 --> 07:20.600
log in as a particular user into that third party platform and have a connection that isn't just like

07:20.640 --> 07:27.440
a connection to to Google overall, a connection to all of Gmail, but rather it's a connection to Gmail

07:27.440 --> 07:32.400
and to my email account on Gmail, which I have to authenticate against.

07:32.440 --> 07:34.840
It has to be on on that level.

07:34.840 --> 07:37.440
It's like an application level integration.

07:37.680 --> 07:39.120
That's where it gets harder.

07:39.120 --> 07:42.160
And the name of the game there is OAuth two.

07:42.360 --> 07:48.600
That is the the standard and the approach that's used for a rock solid connection to a third party,

07:48.600 --> 07:51.760
where you are authenticated as the user in question.

07:51.760 --> 07:56.360
And both of these next two variants are different flavors of OAuth two.

07:56.400 --> 08:04.740
The simpler of the OAuth two patterns is exactly what we did with Google Sheets and with Gmail, which

08:04.740 --> 08:10.580
is where there is a sort of pre-configured OAuth two where you can go into N810.

08:10.620 --> 08:15.740
You can sort of press a button that launches a screen with, with, say, Google, and then you sign

08:15.740 --> 08:16.900
into your Gmail.

08:16.900 --> 08:21.420
And when it comes back to it's all done and there you are.

08:21.460 --> 08:27.060
You're authenticating for a specific end user for like your Gmail account and N810.

08:27.060 --> 08:29.660
And this has to this only works with N810 cloud.

08:29.780 --> 08:33.900
N-r10 cloud has already established connectivity with Google.

08:33.900 --> 08:39.780
Overall, they've already built the bridge so that it can reach into Google, and Google can call back

08:39.780 --> 08:41.100
to N810 Cloud.

08:41.100 --> 08:46.220
So all of that sort of scaffolding is in place, and all you have to do is click the button, sign into

08:46.260 --> 08:47.940
Google and it's done.

08:47.980 --> 08:49.180
You're authenticated.

08:49.380 --> 08:52.700
So that is what I'm calling it here pre-configured OAuth two.

08:52.860 --> 08:58.820
It only works with N810 Cloud, and only where N810 Cloud has already built that bridge, as they've

08:58.820 --> 09:04.520
done for Google Sheets and for Gmail, as we saw where it's harder is where there isn't this sort of

09:04.560 --> 09:09.720
shortcut built into cloud, and you have to build the scaffolding yourself.

09:09.880 --> 09:12.920
And that is the proper full on OAuth two.

09:13.040 --> 09:16.560
And that applies for any OAuth integrations if you're running self-hosted.

09:16.600 --> 09:17.280
Natan.

09:17.320 --> 09:22.360
But if you're using Natan Cloud, it's some of them, the ones that don't have this built in bridge.

09:22.520 --> 09:29.880
And that requires a sort of multi-step process to to authenticate yourself with the third party platform.

09:29.880 --> 09:32.880
Let's call it slack, because it's going to be that way with slack.

09:33.040 --> 09:39.520
Uh, and, uh, you have to tell slack how or the third party, how it's going to call back to you once

09:39.520 --> 09:40.800
the authentication has happened.

09:40.840 --> 09:44.520
And so there's there's bits and pieces to put in place, and it's quite fiddly.

09:44.680 --> 09:47.880
OAuth two done properly like this is quite fiddly.

09:47.920 --> 09:51.720
It requires, as I put here, patience and a thick skin.

09:51.720 --> 09:56.320
Sometimes you'll be cussing and you'll have to do it 2 or 3 times until you figure out all the kinks

09:56.320 --> 09:57.960
and you have it all working properly.

09:58.120 --> 10:04.020
But the good news about all authentications in Natan is that once you've done it and you're authenticated,

10:04.020 --> 10:05.580
it's then super simple.

10:05.580 --> 10:10.540
Once you've built your authentication with slack, you can then put any nodes and connect them with

10:10.540 --> 10:15.660
slack just like that, by selecting that that authentication, those credentials in that dropdown.

10:15.660 --> 10:18.700
So it's like a one time thing for each of your third parties.

10:18.740 --> 10:21.460
Sometimes it can be, as I say, quite fiddly.

10:21.460 --> 10:24.500
Sometimes it can try your patience as you will see.

10:24.580 --> 10:27.300
But in the end, once it's done, it's done.

10:27.340 --> 10:29.620
And with that I have some integrations for you.

10:29.620 --> 10:30.540
That's enough talking.

10:30.540 --> 10:35.020
We're going to go and start building and I've got like three integrations we're going to work on and

10:35.020 --> 10:37.380
they're all about connectivity.

10:37.420 --> 10:40.380
It's all about information coming in and out.

10:40.620 --> 10:46.420
The first of them is one of my old favorites that I cover my other courses too, which is push notifications

10:46.420 --> 10:52.780
to your phone because it feels so nice and simple and fun to have something pushed to your phone.

10:52.780 --> 10:54.060
And so we'll be doing that.

10:54.060 --> 10:57.700
And that's going to be a gentle API based one.

10:58.140 --> 11:00.180
The next one is going to be telegram.

11:00.380 --> 11:03.430
Now, you may or may not use telegram.

11:03.430 --> 11:04.910
If you don't use telegram.

11:04.950 --> 11:08.190
Then just use this as a way to see how you do this kind of integration.

11:08.190 --> 11:09.750
It's relatively straightforward.

11:09.750 --> 11:13.550
It's going to work nicely, and you don't need to have telegram at all.

11:13.550 --> 11:18.550
But the same kind of principles apply to many of the other integrations in Pn10, so it's still worth

11:18.550 --> 11:19.430
seeing what I do.

11:19.590 --> 11:21.310
And the third one is slack.

11:21.310 --> 11:23.590
And slack is going to be a right pain.

11:23.590 --> 11:25.870
So prepare yourself for agony.

11:26.070 --> 11:29.830
Uh, but and again, you can just watch me if you don't feel like you want to do it, use it as a way

11:29.830 --> 11:34.030
to see how you have to work on the full OAuth two flow.

11:34.030 --> 11:41.310
So we will have a slack integration as well, and as a quick like survival guide for integrations.

11:41.470 --> 11:47.510
First, if an integration, uh, goes goes pear shaped for you, then try again.

11:47.750 --> 11:52.430
You may need to try several times and just just troubleshoot as you go.

11:52.430 --> 11:55.110
And watch out for clues as to what's going wrong.

11:55.550 --> 11:57.670
Post in Udemy for help.

11:57.830 --> 12:03.010
Uh, I may or may not be able to help if I can't reproduce it, but someone almost certainly can.

12:03.050 --> 12:05.290
I'll reply and I may say try this.

12:05.610 --> 12:06.970
Send screenshots of this.

12:07.010 --> 12:12.530
We can try and figure it out, but often it just takes, uh, trying it several times, getting to see

12:12.530 --> 12:13.410
if other people help.

12:13.450 --> 12:17.010
I should also say here, do read the docs in there.

12:17.010 --> 12:17.610
So great!

12:17.610 --> 12:22.050
The docs are so clear and use that as you go through it to try and figure it out.

12:22.330 --> 12:28.250
And if that doesn't work, if I can't help you or no one else replies, if all else fails, just pick

12:28.290 --> 12:30.050
another thing to integrate with.

12:30.090 --> 12:32.890
The incredible thing about Nathan is that it has so many.

12:32.930 --> 12:38.650
The choices are so enormous, and that means if you get stuck with one, then there comes a point when

12:38.650 --> 12:39.770
you're like, forget it.

12:40.090 --> 12:42.330
I can't integrate with with telegram.

12:42.330 --> 12:44.690
Let me pick slack or I can't do telegram.

12:44.690 --> 12:46.290
Let's just do a push notification.

12:46.330 --> 12:47.890
Pick something different.

12:47.890 --> 12:52.930
There's many to choose from, and if one of them doesn't work, another one surely will.

12:52.970 --> 12:55.570
Okay, with that, let's go back to Nw10.

12:55.650 --> 12:59.450
Let's work on three communication related integrations.

12:59.610 --> 13:03.050
And uh, yeah, have a thick skin, but it's still it's going to be fun.

13:03.050 --> 13:03.690
Let's see.
