3. Split Out - SCAI017
Sloup
1 follower
Sep 15, 2025
Nate Herk - AI Automation Society Plus\3. Depp Dive Building AI Agents\4. Core Nodes\3. Split Out - SCAI017
Okay, so another thing when it comes to data manipulation is going to be splitting data if
it's in a list, getting them sort of individualized or splitting them out. And then on the other side
of that is aggregating them. And then from there, there's also other concepts like merge and looping
through. So I think we'll pretty much just go in that order. So we're going to start with splitting
out. So if we went here, split out, this is the node we have. First, let me show you guys the
input data. So what we have here is a list of five items. And we have customer ID for each one,
a name for each one, and an email for each one. So what we're going to do here is in the split
out node, drag fields from the left or type in their names. And this is interesting, because
you might typically think that you need to do like it as an expression, because when you drag them
in, you know, you normally that's when you want to use an expression. But let's see here, if I
were to drag in JSON, the customer ID, this is going to give us the actual value of the field
customer ID. So the value is one. And so this is basically telling the node, we want to split out
the field one. And so that's not going to work. The field is not called one, right? The field is
called customer ID. So what we need in here is either to type in customer underscore ID,
split that out, now it's going to work. Or similarly, we can do the same thing by keeping
it fixed and dragging in the customer ID. I think that maybe it needs to be a little more clear. But
that's how that works. So it's going to look like it's static. But it's I mean, I guess,
technically, it is because we're referencing a field, not the values in the field. But anyways,
then we've got some other options, we've got what if you want to include other things.
So we could include all other fields, we hit test step, and it's going to split out everything.
And because we split out customer ID, it's going to reference that at the end,
we could say no other fields, which is the first one that we did where we're just going to be
getting customer ID now. Or we could do selected other fields, let's say we just want their ID and
their name, we don't care about their email, let's get just their ID and their name. So that's a
simple one, it can help you kind of cut down on the data if you need to limit it a little bit.
Also, another use case would be if you want to get items split into like from one to many. So
okay, like I said, let's let's get rid of this, this input data. And we're putting in basically
a list of products. So now we have a list of products. And we want to get this split out,
because right now this is kind of ugly the way we want to reference it. If you watch my team of
research agents to create a newsletter, what we did is we had a list of titles and descriptions,
and we wanted to split them out. So we could individually send each pair of lists and each
pair of titles and descriptions to an individual agent. So as you can see here, we've got six
products. And we want to split them out. So let's basically just reset this field.
Sorry, reset the parameters, what we want to do is we want to split out the product list. So as
you can see, six over here, we want to split them out, we're going to now get six individual items,
where we have the ID, the name and the quantity. So it's just going to be easier for us to
manipulate and play with. As you can see right here, one item came through out of the original
data set, and then we have six items being split out. And then we can take the action we need based
on these products and their IDs, and the name. So that's pretty much going to be it for the split
out node can be really helpful.
