So this isn't a no code course.
It's a low code course, which means occasionally we will take a little step in the direction of coding.
And one of the ways is through expressions.
And you're going to love expressions.
Expressions give you this ability to be much more flexible about about how your workflow runs.
And it allows you to to have a lot more power in what goes on.
Basically, rather than using some fixed value for doing something, you're able to determine dynamically
what should be used.
It's like a formula in Excel instead of the value.
And and honestly, they're not complicated.
They can look intimidating at first, a bit like an Excel formula, but once you get the idea of them,
and once you've got a few in your arsenal that you can just reuse in different places, then you will
find this to be to be super easy.
So let's look at some of them and and then we will use them in earnest.
If this seems very theoretical, but we are going to put this into practice in our integrations coming
right up.
So there are a bunch of fields in NHSN where you'll see a little toggle above the field that can switch
between being fixed and being an expression, and that is where we will be using them today.
And that's where you can say, okay, I want this, this to always be the number three, or I want to
give you a little bit of, of a formula for calculating what this value should be.
And expressions are surrounded in double curlies, two, two sets of curly braces like that.
So you get used to seeing these double curlies everywhere.
And so you should immediately click.
And when you see that, you think, okay, it's an expression and there's a there's something to know,
which is just, just a nice little shortcut that if you want in any of your expressions to access whatever
is the incoming data from the node before where you are, then you use this particular thing here,
dollar sign and then the word JSON.
That means I want to have access to the incoming data in JSON format.
So a lot about these expressions comes down to navigating your way through a JSON object.
You remember that JSON is key value pairs, and that the value might itself be an object with key value
pairs.
So often you're saying something like, okay, I've got a person, I want to get the first name, or
I want to get the address and the country of the address of the person.
So you're often like drilling down into these JSON objects.
And the way you do that is with a period a dot.
So you can say if we if we have an object like this same person thing that we just looked at before,
it's got a name, an age and an address.
And the address has a street, a city and a country.
Then if you did JSON dot name, you'd be plucking out Alice from this structure.
If you did JSON dot address, you're plucking out that that little section under address dot city.
Then you're plucking New York out of that structure.
So look in purple at the JSON name and the Jason address city and then reference the yellow box above
it and just check you fully understand how those dots allow you to drill into the JSON and pluck out
the information that we need from that data, and that is really giving you all the perspective you
need on data structures in JSON, and on how you write expressions and use dots to drill into them to
retrieve specific data items.
Now, at various points, we will be doing things that are just slightly more fiddly with expressions
than JSON.
I want to show you what they look like.
You do not need to understand these right now, just just so that you're aware of it.
We'll be doing much more of this in due course.
And if you do know about this, if you do know about JSON, then then just it's worth knowing this.
So a couple of expressions we will use at some point.
So I showed you that dollar JSON gives you access to the data that's incoming into this node that we're
working on right now.
But what if you wanted to look at some data from a prior node somewhere else.
Well, there's there's a trick to doing that instead of dollar.
Jason.
You do dollar node and then in square brackets as it shows right here, you put the name of that node.
And that allows you to grab data from any previous node in your workflow.
And that means that that you can write an expression which is able to combine information from across
the whole workflow.
And then one other little thing to know is that what if you want to to take some JSON and turn it into
a string, turn it into text, for example.
Because because you want to pass it to an LM or something like that, then it's worth knowing there
is this thing called Stringify.
You put JSON and block capitals, dot stringify, and then you can pass in anything in those brackets
inside those brackets and it will turn that into text.
So json.stringify and then perhaps dollar JSON, which is the incoming data will turn the incoming data
into plain text.
So if you're if you're new to this, that might not make complete sense.
In which case, don't worry.
Just just just, uh, just look at remember this vaguely.
Get some intuition.
We'll see it in practice.
It's when you actually experiment with this and build it for real that you see it coming together.
And if you are familiar with the JSON, then these are two expressions to know about.
And as a general principle, I would say you never need to memorize anything like this.
Don't don't memorize these things.
As long as you have some understanding of it, you can always look up at the time how to do a particular
expression.
Great documentation in Na ten or ChatGPT or Claude will tell you exactly what expression that you need,
but it's good to recognize what it looks like when it's when it's the right answer.
Okay, that's it for both JSON for data and expressions.
At least that's enough for now for us to build a bunch more integrations.
But before we go and do that, I do want to sort of introduce the topic of the integrations that we're
going to do today, and they're going to be great fun.
So often the stickiest part of building an integration with a third party is called authentication,
which is convincing the third party that you are who you say you are.
And there are a number of different approaches for this.
And we're going to be using all of these approaches.
And here they are in in order of increasing complexity.
Uh, the and of course, there are many different ways to authenticate with third parties.
These are the ones that we'll be using through NHSN.
The first of them is the easiest of them all.
And it's when you have an API key, you've established an API key with the third party, and you provide
that API key in N810.
And then you have the connection.
And that's what we did with with the open router and with with OpenAI.
And what we will do with many.
It's super easy.
An API key is like a password.
It's like a secret.
And once you've put it in there and you've shown it, it appears green in n810, you know you've got
the connection.
All is good.
Uh, if only if only it was.
It was that easy for everything.
So obviously the time that it's harder is when you don't just want to have, like one bridge to a third
party.
Like, I want to be linked to OpenAI and have an OpenAI key, but rather you want to be able to to to
log in as a particular user into that third party platform and have a connection that isn't just like
a connection to to Google overall, a connection to all of Gmail, but rather it's a connection to Gmail
and to my email account on Gmail, which I have to authenticate against.
It has to be on on that level.
It's like an application level integration.
That's where it gets harder.
And the name of the game there is OAuth two.
That is the the standard and the approach that's used for a rock solid connection to a third party,
where you are authenticated as the user in question.
And both of these next two variants are different flavors of OAuth two.
The simpler of the OAuth two patterns is exactly what we did with Google Sheets and with Gmail, which
is where there is a sort of pre-configured OAuth two where you can go into N810.
You can sort of press a button that launches a screen with, with, say, Google, and then you sign
into your Gmail.
And when it comes back to it's all done and there you are.
You're authenticating for a specific end user for like your Gmail account and N810.
And this has to this only works with N810 cloud.
N-r10 cloud has already established connectivity with Google.
Overall, they've already built the bridge so that it can reach into Google, and Google can call back
to N810 Cloud.
So all of that sort of scaffolding is in place, and all you have to do is click the button, sign into
Google and it's done.
You're authenticated.
So that is what I'm calling it here pre-configured OAuth two.
It only works with N810 Cloud, and only where N810 Cloud has already built that bridge, as they've
done for Google Sheets and for Gmail, as we saw where it's harder is where there isn't this sort of
shortcut built into cloud, and you have to build the scaffolding yourself.
And that is the proper full on OAuth two.
And that applies for any OAuth integrations if you're running self-hosted.
Natan.
But if you're using Natan Cloud, it's some of them, the ones that don't have this built in bridge.
And that requires a sort of multi-step process to to authenticate yourself with the third party platform.
Let's call it slack, because it's going to be that way with slack.
Uh, and, uh, you have to tell slack how or the third party, how it's going to call back to you once
the authentication has happened.
And so there's there's bits and pieces to put in place, and it's quite fiddly.
OAuth two done properly like this is quite fiddly.
It requires, as I put here, patience and a thick skin.
Sometimes you'll be cussing and you'll have to do it 2 or 3 times until you figure out all the kinks
and you have it all working properly.
But the good news about all authentications in Natan is that once you've done it and you're authenticated,
it's then super simple.
Once you've built your authentication with slack, you can then put any nodes and connect them with
slack just like that, by selecting that that authentication, those credentials in that dropdown.
So it's like a one time thing for each of your third parties.
Sometimes it can be, as I say, quite fiddly.
Sometimes it can try your patience as you will see.
But in the end, once it's done, it's done.
And with that I have some integrations for you.
That's enough talking.
We're going to go and start building and I've got like three integrations we're going to work on and
they're all about connectivity.
It's all about information coming in and out.
The first of them is one of my old favorites that I cover my other courses too, which is push notifications
to your phone because it feels so nice and simple and fun to have something pushed to your phone.
And so we'll be doing that.
And that's going to be a gentle API based one.
The next one is going to be telegram.
Now, you may or may not use telegram.
If you don't use telegram.
Then just use this as a way to see how you do this kind of integration.
It's relatively straightforward.
It's going to work nicely, and you don't need to have telegram at all.
But the same kind of principles apply to many of the other integrations in Pn10, so it's still worth
seeing what I do.
And the third one is slack.
And slack is going to be a right pain.
So prepare yourself for agony.
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
to see how you have to work on the full OAuth two flow.
So we will have a slack integration as well, and as a quick like survival guide for integrations.
First, if an integration, uh, goes goes pear shaped for you, then try again.
You may need to try several times and just just troubleshoot as you go.
And watch out for clues as to what's going wrong.
Post in Udemy for help.
Uh, I may or may not be able to help if I can't reproduce it, but someone almost certainly can.
I'll reply and I may say try this.
Send screenshots of this.
We can try and figure it out, but often it just takes, uh, trying it several times, getting to see
if other people help.
I should also say here, do read the docs in there.
So great!
The docs are so clear and use that as you go through it to try and figure it out.
And if that doesn't work, if I can't help you or no one else replies, if all else fails, just pick
another thing to integrate with.
The incredible thing about Nathan is that it has so many.
The choices are so enormous, and that means if you get stuck with one, then there comes a point when
you're like, forget it.
I can't integrate with with telegram.
Let me pick slack or I can't do telegram.
Let's just do a push notification.
Pick something different.
There's many to choose from, and if one of them doesn't work, another one surely will.
Okay, with that, let's go back to Nw10.
Let's work on three communication related integrations.
And uh, yeah, have a thick skin, but it's still it's going to be fun.
Let's see.