table to xml

Hello, I have to generate an XML with the following structure:


   <reference>PRODUCT 1</reference>
   <reference>PRODUCT 2</reference>
   <reference>PRODUCT 3</reference>

Where the PRODUCT 1, 2, etc. need to be replaced by the values from a table like this one:


I have been exploring the “Column to XML” and “String to XML” nodes, but I cannot find a way to achieve what I need. Does anyone have any ideas on how I can do this?


Hi @Pablo

I’d say the Column to XML is the right way to go. You need a few of them since the conversion from the table to your desired xml, which is 4 levels deep, is quite a large one.

The trick here is to start at the lowest level, reference, and then work your way up. Output:

See WF:
table to xml.knwf (21.5 KB)


Thank you very much, ArjenEX.
With your explanation and your workflow, I have gained a better understanding of how to work with XML. Your solution is perfect.
I made some changes because if I have more than one model in the base table:


I needed to group them in the xml output like this:

by adding a loop to your workflow, I was able to resolve it.

I am attaching it in case it can be helpful to someone.

table to xml v2.knwf (16.0 KB)

Many thanks for your help!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.