So, after a bit of a break, it’s time to get back on the horse. Today, I thought we’d look at another DRM feature that has been around forever, but one, that I think gets lost during implementations. I am talking about the pivot feature, when using DRM exports.
Recently, a requirement came up, where I had to do one-to-many data mappings. For instance, if I had to generate multiple records for the same node, as seen below; how would we go about it?
We could create multiple properties to capture the second description, I suppose. But where would that end? Moreover, it would require multiple “save” actions from the user which might be painful as well. There are other ways to skin this cat, but here’s a simple one. It starts with the property setup. I am going to use a list group data type to explore this example.
As the name suggests, we are able to make multiple selections, when using this type of property.
Our hierarchy, now looks like this.
All we have to do now, is set up our export. I’ve chosen to export only leaf nodes (a great option for setting up mapping table exports, BTW).
On the columns, I’ve selected the node name and beer category properties.
I’ve also made sure to select the pivot option, from the Column Options tab.
If we now run our export, we get the right results.
Oh, and what happens if we change our property to be a boring string property? And, no longer a list?
I made some changes to the property values, to elaborate the point.
Let’s see how this affects the pivot operation.
As you can see, pivot operations are triggered by commas. So, be careful with setting the right data type, when setting up your property! Examples of these would be associated nodes, multiple node etc. That’s all for my first post of 2017.