Monday, July 13, 2015

Displaying Managed Metadata Columns in Nintex Workflow for Office 365

This post addresses a key limitation in Nintex for Office 365, displaying managed metadata columns in Nintex workflow emails. In this post I will walk you through step by step how to get your managed metadata to display in a text value instead of breaking your workflow.

In previous versions of Nintex Workflow you could simply reference your managed metadata column in your email and it would return as a text value. If you have tried this in Nintex for Office 365 you probably had something like this:


But when you ran the workflow it errored with a message like this:

This is because Nintex for Office 365 has issues processing managed metadata fields into strings. However there is a workaround to this! When you’re finished, your workflow will look something like this:


The first thing to understand is how managed metadata columns are handled in Nintex for Office 365. When you are referencing a managed metadata column you will notice that there are two columns. One will be the normal name of your column and that other will be a similar version of that name with “_0” at the end.


This is actually the column that you want to use when referencing it in your workflow. The field ‘Managed Metadata_0’ is read by Nintex as Term|GUID. For example our term is ‘Example for email.’ You can see below that when that column is logged in Nintex it returns as “Example for email|c0622833-c2d1-4a7c-8932-b19d75c55e60”


The problem here is that the variable we use for our emails will not read our name and GUID as a string. So we need to jump through some hoops to get Nintex to pull out just the name of that. We’re going to add a regular expression that splits our term into text and GUID and store those two items in a dictionary. Then we will be able to use a ‘Get an Item from a Dictionary’ action to grab the text out of there.


In your regular expression you will want to use that column with the “_0” mentioned earlier for the string. This will ensure that Nintex will be looking for the Term|GUID format.

For your string operation you will use split to divide the Term|GUID into a text term and a GUID. The pattern is the most important part. We are looking to split it at the | however Nintex actually sees this as a special character and will not read it. To account for this you need a preceding forward slash “\” that tells Nintex to use the character as is.

Finally, for your output use a Dictionary variable. This will store the term and the GUID in the dictionary as two separate values.


Now to display your new text value in an email you have to grab it from the dictionary. Drop in the “Get an Item from a Dictionary” action and configure it as seen above. The “Item Name or Path” should be (0) since you are telling Nintex to pull the very first item in the dictionary. This will give you only the text term. In contrast, if you only wanted the GUID you would use (1) for the pattern. Once the pattern is set you just need to tell it to look in your newly created dictionary. In this dropdown, select the dictionary we created in the Regular Expression step. Finally, we will store your new output in a text variable.

And that’s it! Now whenever you need to display the text from a managed metadata column have Nintex reference the text variable you created in the last step and you’re good to go.