Split a result after "set"

i am geting a webhook that has a json file with 2 lins that i need

  1. is the phone munber
  2. is the name

so i do a “set”
to clear the noise and i am geting item with 2 items inside

  1. phone number = [email protected]
  2. name = name

how can i separate so i will have the phone number alone?

Hi @Yossi_Yhezkel

You can use the keep only set boolean in the set node. This will only keep the values you actually set in the node.

If it is multiple lines you could use the IF node to filter the lines you want to get.

Hope this helps.
If not please share sample data so we can understand it better and fix an example for you.

this was the solution

for (item of items) {
item.json.phone = item.json.phone.split(“@”)[0];

Ah thats what you wanted to do :sweat_smile:
You can also do this in a set node like below. The first is for dummy data second is your split function in the expression editor.

1 Like