I’m new on n8n, so sorry in advance if my question may seem trivial or a bit silly.
My question is very simple, I have an XML file like this one:
How could I extract for example specifically the field with the tag “015” and the code “a”, which would give me “00914463” please ?
Because when I want to transform it into XML to JSON, I lose the separation by tag, I have then all the “mxc:datafield” which are added, but I really need by tag.
Thanks in advance to you
Hi @Dadourlou, welcome to the community
Any chance you can share your XML file as text rather than a screenshot? This would make it a lot easier for peeps to give it a go
You can use the option for preformatted text to share code:
Obviously, sorry for the omission, I edited my message by putting the URL of the file (it is a French public API).
Perfect, thanks a lot!
I have put together an example workflow extracting
00914463 for you:
In this workflow, I first convert this XML data into JSON data. Then throw away the values I am not interested in using the Set node, splitting out the results via an Item lists node to filter these for the tag in question.
I then split out the subfields for the matching tag and filter for the correct code before formatting the result:
Hope this helps! Let me know if you have any questions on this