The amazing new workflow engine for SharePoint 2013 is one of the most powerful things I have ever seen. Compared to the previous version it's fun to use and design workflows with the this engine, and the results are actually matching with your expectation. There is only one simple case, where the result was not exactly what was expected. When a user creates a workflow and access the list item from the workflow, the managed metadata fields are returning only the identifier of the term set. From a technical perspective this makes sense as those identifiers are used to lookup the correct item from the termstore. Anyway from an end-user perspective that looks somehow confusing.
This blog post explains on the example of extracting a managed metadata field the use of the following actions:
In addition it shows shortly how to explore the SharePoint 2013 objects from the browser.
Inside a workflow we need to be able to have a condition based on the text value entered into a managed metadata field. Instead of using the termset identifier, the user designing the workflow wants to see the text value.
The newly introduced HTTP web service action gives you a very powerful way to solve problems like this. To solve exactly this issue a HTTP web service action is and the values are loaded from the SharePoint server. The following example shows how this can be done.
Precondition and Limitation:
The SharePoint 2013 workflow with the workflow manager has to be installed on your farm. More information: http://msdn.microsoft.com/en-us/library/jj163276.aspx
When you are using this solution please be careful with renaming managed metadata, as this could affect your workflow. In addition the solution create one additional call back to you SharePoint server, but this shouldn't affect the performance. Finally the proposed solution doesn't support multi value managed metadata fields.
Note: If you see something like the following image, please read the blog post: http://www.fiechter.eu/Lists/Posts/Post.aspx?ID=36&mobile=0
Note: If you don't want to use the GUID you can also use the display name of your list:
https://<site collection url>/_api/Web/lists/getByTitle('Workflow%20Demo')
Attention: Please ensure that the field is not a multi value field!
Note: As this entry is more fore debugging purpose, you should remove it before delivering the workflow to your end-users.
That's itJ, afterwards you can create your conditions based on the value inside the ManagedMetadataValue variable. To ensure that it works, start the workflow from your list and see the results, by clicking the instance:
To summarize here is the complete workflow created.
The workflow creates the request header, sends a request to the SharePoint server and extracts the field value of your managed metadata from the response.
REST API for SharePoint 2013: http://msdn.microsoft.com/en-us/library/fp142385.aspx