1. Edit Fields (Set) - SCAI017
Sloup
1 follower
1 Video View·Sep 15, 2025
Nate Herk - AI Automation Society Plus\3. Depp Dive Building AI Agents\4. Core Nodes\1. Edit Fields (Set) - SCAI017
Okay, so we're gonna be breaking down some core nodes,
and when I say core nodes,
what we're gonna be talking about are
kind of just like workflow automation,
data logic flow nodes that don't utilize AI.
So the first one that comes to mind
that I am gonna be using a lot here is set.
So it's, you know, it's actually called edit fields.
I always just call it set.
And the purpose of this node is just to,
basically, you can edit the fields.
You can set things manually.
You can set the field names.
You can map different items.
So as you can see here, we've got manual mapping,
or we've got JSON.
So in this case, if we were to test this step,
we're setting two fields here.
And so just to understand, basically,
how JSON structure works, it's very low code,
but it may look a little intimidating.
But if you wanna start doing a lot of stuff with an end,
you're gonna have to understand JSON structure,
which is very simple.
So basically, it's gonna be key value pairs.
So in this case, we have a key,
which is my field one, and it equals,
or its value is value.
Similarly, with this key, which is called my field two,
its value is one.
And so the first thing to note
is that we have different types of data coming through.
This one is a string.
And if you hear string, that just means a word.
You know it's a string because it's in quotes.
And here we have a number,
which is just a number type variable.
And so if you were to come over to schema,
on the right-hand side, you could see value is a string,
or sorry, the key, the field called my field one is a string
and we see that there's a little A right here.
So we see this A, and then we see that my field two is one,
and it's a number because it was set to
equal that pound sign.
So number, string, and then you're also gonna get objects,
which will look like a little block
where that little icon should be.
So that's how you do JSON.
But typically, we're gonna set with,
I'm just gonna do manual mapping.
So as of now, there's no items in here.
Let's say we wanted to set a field called query,
and we wanted to just set this to hello.
Hit test step, it's gonna pop over here as hello.
In the table view, that's what it looks like.
In JSON, it's gonna look like this.
As you remember, the key is query, the value is hello.
And then of course, you can set the data type here.
So let's say we wanted to set that to a number.
It wouldn't take hello.
It can only take E, I'm typing.
It only grabs E because E is sort of like a number,
in the sense of algebra.
But, sorry, I was trying to think of a number.
So 74, now we can set it to a number 74.
It's coming through as a number.
Let's say we wanted to go to a Boolean,
which is gonna be basically true or false.
We've got an array, which is gonna be
basically a list of items.
So we expected an array, but we got true
because it's not actually coming through as a list.
And then like I said, we've got object, which we got true.
So at some point, we'll break down
these data types a little bit more.
The point of this one is just to understand
what this node is doing.
So let's say, okay, here's a good example.
So let's say what's coming through here
is a execute workflow trigger.
So if you remember from that previous module,
an execute workflow trigger just means
that we're going to be capturing data right here.
We're gonna be capturing information
from a different workflow that's sending us information.
Typically, this would be an agent that we create.
One thing we're gonna do real quick
is just change the input data to accepting all data.
And so typically, when we're capturing information
with this trigger, it's going to be an agent
that's sending data to a tool that we created,
which would be this workflow.
And this process of whatever goes through this flow
is the tool that we created.
So like if you watched my personal assistant video,
we'd create an agent right here.
This would be an email agent,
but then we'd have the larger personal assistant agent
call it.
Or if you watched the newsletter video
with the team of research agents,
and it was calling a tool called Tavoli,
we set up a different workflow where we had this trigger
feed into Tavoli request that would then respond
back to the agent.
And so what I wanna talk about real quick is two things.
First one is getting the data
and then being able to set the fields,
and then responding to an agent
if that's how you called this tool in the first place.
So what I'm doing now is just manually setting
some information.
So we're gonna leave it as this.
We're gonna get name first step or name first item,
code one, name second item, code two.
So we have two items coming out of this trigger.
As you can see on the left side, two items.
And what we're gonna do is let's say we wanted to set
the instead of calling it name,
we wanted to call it identifier.
And then what we could do is drag in this value.
And so obviously if we have, if it goes green,
if we have these two curly braces,
it just means that it's calling a JavaScript variable.
So right now, obviously we typed in here is json.name,
but what we're getting is result, which is the first item,
as you can see from over here.
So we can obviously do the drag and drop,
which is super cool.
But just so you can also understand,
if we type in two curly braces,
we're gonna get a list of options to pop up.
You can see we have different functions.
We can call it specific nodes.
So what we're gonna do is we're just gonna do json
because we're referencing what was just coming back
right before this node.
If you do json, it's gonna be what's coming back
right from here.
I'll probably make a video about this kind of stuff
more in depth.
Anyways, now you can see we have an object.
We have a pair of name and code.
And so we wanted to specify something more specific.
We'll put a period and let's say we can either grab code
or the name, we're gonna grab the name
and now we're getting first item.
So now we're getting that data.
And so let's say we're grabbing from here.
I don't know why it's waiting to execute,
but anyways, let's stop this.
And so we're grabbing that data
and now we have two items coming through here.
Now, if we wanted to respond to the agent,
we're typically gonna grab a set field again, manual map.
We're gonna name the field response
and then we wanna drag over
whatever we're sending to the agent.
So let's say in this case,
we wanna just send over the identifier.
Now, the agent that originally started this whole workflow
by calling this trigger is going to be sitting
and waiting for a field called response.
And so then when we test the step,
I can't click in there.
When we test the step and we get, hello.
Okay, it's being weird because the trigger.
Anyways, we get the response over here,
which says first item, second item.
That is what is going to be sent over to the agent.
So like I said, we'll have another video at some point
that kind of breaks this process down more in depth,
but this is how it's working.
So that's the set field.
It can be really handy
if you just wanna change the name of something,
if you wanna grab something
and then you'll be able to reference it later,
just because as you can see, we're getting the same data.
It's always first item, second item.
But at here, we change it to identifier
and then here we change it to response.
So that's all we really did here.
But anyways, let's move on to the next core node.
