Hi. Sorry for a dumb question, but how do I get only “loc” as separate items in the example below? I am obviously doing something wrong, but cannot figure out what exactly as I keep getting this error: ERROR: Couldn’t find the field ‘url’ in the input data
I thought the pinned data would show here, but it doesn’t. The output of XML node:
Hi. I am trying to do something very similar and cannot seem to get it to work, maybe my dot.syntax is incorrect.
What I would like to do is split the high level sports into two items so that i can insert these in the coming nodes, and then do the same for teams. The other issue is that I would like to take the sports values and team values and insert them into mautic, however each time i receive a webhook there could be a different number of sports and a different number of teams so i would need to loop over them.
would be best to open a new topic for this one.
Your data seems to be completly different, not as straighforward as the data discussed in this topic.
Especially because you say the input is going to be different everytime.
For this it would be best to get some different examples so we can see where the differences are and help you out with that.
To answer your specific question, yes the dot notation is incorrect. as the body is an array and this is what you need to fill into the parameter. body.3 is not valid. Probably you would need to first do the body and then find and extract the array and values you are looking for out of the third item. But I am not sure until you post a few examples of different inputs. Please do in a new topic.
I use “{{ $json[“Name”].split(‘ ‘) }}” to split characters from the name and it works perfectly. However, in my usage case, I need to get the last name or first name. For example: with ‘Dao Thi Kim Trang’ or ‘Dao Thi Kim’, I just want to get the last name, which is ‘Trang’ or ‘Kim’. How should I do it? Thank you.
n8n includes a little helper method .last() for such cases. So if you have a Name field and you want to get the last word in this field you could use an expression of {{ $json['Name'].split(' ').last() }}
On a more general note, you might want to open a new topic on the forum when a topic is already marked as solved. Otherwise questions can easily get missed. Hope this makes sense!