How to set a condition against a managed metadata field in SharePoint designer 2013 workflow. RRS feed

  • Question

  • Hi!

    I'm working on a SharePoint 2013 publishing approval workflow that needs to compare if a managed metadata field in a newly created item is set to a specific value. This in order to assign a task to a sharepoint group if the condition is true. I'm having difficulties in finding the value of the MMD field. I've tried to do it in the Term|GUID-way(Term|xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). But I don't get any values at all.

    If anyone has some pointers or advice on this issue, it would be great!

    Thanks, Joakim

    Wednesday, February 6, 2013 9:20 AM


  • Hi,

    Hope it helps !!


    Wednesday, February 6, 2013 9:58 AM

All replies

  • Hi,

    Hope it helps !!


    Wednesday, February 6, 2013 9:58 AM
  • Although the proposed solution works, it requires you to modify your content type to add an unnecessary calculated column. Since you are doing this using SharePoint 2013 workflow, you can just declare a few Local Variables such as:

    • varMMD_0
    • varPosPipe
    • varMMD

    Then in the workflow, do the following:

    Set Variable: varMMD_0 to Current Item:YourMMDfield
    then find | in Variable:varMMD_0 (Output to Variable:varPosPipe)
    then Copy Variable: varPosPipe characters from start of Variable:varMMD_0 (Output to Variable:varMMD

    At the end, your varMMD contains she string stripped from the pipe character followed by the GUID of the managed metadata.

    This is only possible in 2013, as the string manipulation is a new feature.
    hope this helps,


    Thursday, August 22, 2013 1:38 PM
  • Pierre, This looks like a great solution and makes sense. I however am receiving an error when retrieving the MMD field. Any ideas? My MMD field in this example is DocType. I have other MMD fields as well and tried them with the same result; cannot be read as type 'String'.

    RequestorId: f627bce0-cd2c-d08c-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.InvalidCastException: The value 'd/results(0)/DocType' cannot be read as type 'String'. at Microsoft.Activities.GetDynamicValueProperty`1.CheckedRead(String propertyName, DynamicItem value) at Microsoft.Activities.GetDynamicValueProperty`1.Execute(CodeActivityContext context) at System.Activities.CodeActivity`1.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation) Exception from activity GetDynamicValueProperty<String> Sequence DynamicActivity<String> Assign Then If Document Review Stage 1 Sequence Flowchart Sequence Lien Payoff Approval.WorkflowXaml_07d45fca_536b_4e0e_af87_8a3c6760a710

    • Edited by R a n d y P Thursday, November 6, 2014 6:49 PM
    Thursday, November 6, 2014 6:49 PM