When you search the web for “nintex update managed metadata field” you will find many posts with potential solutions to this challenge. However, you may also find that all of these posts only get you a part of the way there. So, this post is intended to aggregate all of the great information that’s already out there, but hopefully make it simpler for you to combine it all together into one cohesive solution.
Step 1 – Get MMD Term ID by Term Label
This article is where I decided to begin my solution:
There are several different ways to accomplish this step, but I like this one for it’s relative simplicity. I followed steps 1 and 2 pretty much to the T. My final Web Service call is as follows:
But, then I ran into issues around Step 3.
Format XML result for parsing
Turns out the XML that was being returned/stored was not in the expected format. So, I ran a couple of Regular Expression actions to resolve the formatting issues as follows:
These replace & l t ; with < and & g t ; with > respectively.
Parse XML and format result
Once you have the XML containing the Term ID (in the proper XML format), you need to parse the XML to pull it out. I loosely following Step 3 in the above referenced post for this step, but once again altered my approach slightly. My XML query looked like this:
This left me with the following value in my sltTaxonomyID variable: a9=”98ff473a-b384-496e-b4cb-eaa01de0f3d8″, but all we really need is the value between the two quotation marks. So, I followed this step up with a couple more Regular Expression actions (my favorite, can you tell?) as follows:
These removed the leading and trailing characters respectively, giving an output of 98ff473a-b384-496e-b4cb-eaa01de0f3d8 in my sltTaxonomyID variable.
Step 2 – Build two values for MMD update
For this part, I referenced a combination of these two posts:
Essentially, this step requires you to create two Single line of text variables (via the Build String action) for use in the final step of this solution.
Step 3 – Update MMD column via Web Service
The final step in the solution requires a bit of prep-work. You’ll need to get the internal name for the MMD column you want to update and you’ll also need to get the internal name (in the form of a GUID) for the corresponding Note field that is part of the SharePoint Managed Metadata structure. The above referenced two posts provide nice discussions around the concept of a MMD column being made up of two fields – the Taxonomy field and the Note field, so I won’t go into that here. Instead, I’ll focus on how I brought all of the pieces together to meet my requirements.
Once again, I deviated slightly from the two approaches referenced in the above two posts to retrieve the internal name for the Note part of the MMD column. For this, I referenced one final post:
I leveraged Step 1 in this post to retrieve the internal name of my MMD column. This was the final piece to my puzzle and from there I put it all together in a Web Service call as follows:
You’ll notice the format of the Web Service message reflects one of the referenced posts, but I’ve updated it to dynamically grab the List Name and use the internal name of the Note field instead of the various solutions referenced in the other posts.
I hope this post serves you well and fills in some of the blanks that you might have come across in your initial investigation into this fairly common challenge.
One thought on “Update Managed Metadata (MMD) column with Nintex Workflow”
Very helpful. Thanks Nicole