Skip to main content
In building a solution in K2, I have datafields and XML fields available to me to store data in. I would like to get some opinions on when one or the other is more appropriate, and when one might have an advantage over the other in the context of K2.

thanks
Jack
normal datafields are easy to work with i.e. easy to read and write. They take up less space in your db than the equivalent in XML. They are also nicely displayed in your K2 reports.

XML is more powerful (for example, you can have repeating sections to effectively store a collection of items in a single XML field). Also, with some more complex code you can do a lot with XML data to display or manipulate it. You will, however, probably create XSLT to display the XML in a friendlier way in the workspace reports, otherwise you just see the raw XML. (There is a K2 knowledgebase article on how to do this easily).

The type of field to use really depends what kind of data you are storing and what needs to be done with the data during process execution. Your business rules may also play a role here, fortunately K2 allows you the choice!

Reply