Quantcast
Channel: Nintex Connect: Active Threads
Viewing all articles
Browse latest Browse all 4245

How-to get ID for Managed Meta-data

$
0
0

Managed meta-data behave a lot like lookup fields. If you get the value, you just get the textual value, but in order to set a meta-data field, you need to have the ID. A colleague and me found a graceful way to lookup the ID of a managed meta-data property (istead of a web service call).

Here I use "Product" as an example meta-data field.

1) Set Variable:  txt_product = currentitem.Product

You get a value like "Hardware:Printer PPU Contract:HP:HP Laserjet 4100 MFP|6709b255-4fe8-40f8-9e32-f93aa807572a"

2) Regular Expression "Replace Text" with Pattern: "[^\|]*\|" --> txt_productId

3) Query list in the Taxonomy Hidden List of the site collection,  http://.../sites/isd/Lists/TaxonomyHiddenList/AllItems.aspx

CAML query used (replace the List ID with the list id of your Taxonomy Hidden List) :

<Query>
    <Lists>
        <List ID="{33dfe138-603b-4ea4-86aa-07ba3cbd6e42}" />
    </Lists>
    <ViewFields>
        <FieldRef Name="ID" />
    </ViewFields>
    <Where>
        <Eq>
            <FieldRef Name="IdForTerm"  />
            <Value Type="Text">{WorkflowVariable:txt_productId}</Value>
        </Eq>
    </Where>
</Query>


Viewing all articles
Browse latest Browse all 4245

Trending Articles