Thursday, September 22, 2016

Nintex workflow errors when setting managed metadata field values in SharePoint 2013

I was setting up a workflow today that was updating several fields on an item.  The workflow was not completing successfully, and the following error message was displayed:

Event Type: Error
Outcome: Unknown Error
Description: The workflow could not update the item, possibly because one or more columns for the item require a different type of information.

That is a bit generic, but it did point me to digging into each of the columns that was being updated.  I found that one of the columns was causing the issue and it was a managed metadata column type.  I was attempting to set the value to equal the display name of the managed metadata choice I wanted. 


 It turns out that the field actually wants the GUID of that value.  I was able to find this via the REST API.  It took a bit of time troubleshooting before I figured that out, so I wanted to post this and maybe save someone else some time.

To get the GUID, I started at the site level with a URL like this:
https://<web app>/<site name>/_api/web/lists/

Then, find the GUID of the list you are working with and add it to the URL
https://<web app>/<site name>/_api/web/lists(guid'<GUID>')/items/

Next, locate an item that has the managed metadata value you want to use in the workflow and look for the "TermGuid"

Copy that GUID to use in your "Update Item" or "Set Field Value" action in the workflow

That was the first workflow I have done that was manipulating managed metadata fields.  Good learning experience for me.  Hope you learned something, too!