Filter Term Store / Managed Metadata / Taxonomy in Power Automate

Learn about the Term store, and how to filter a Term store column in Power Automate


What is the Term Store?

The Term store (also known as Managed Metadata or Taxonomy) is what I would call an advanced choice list. The benefits is that you can provide choices in a treeview style. Another benefit is that the Term store can be accessed in your entire tenant (if you have a choice field created directly on your list, or as a content type, in can only be accessed on that specific site)

The Term store has many names

Term store

Taxonomy

Managed metadata

If you have not worked with the Term store before you can find it in the admin center

https://tenant-admin.sharepoint.com/_layouts/15/online/AdminHome.aspx#/termStoreAdminCenter

Working with the term store

Click on the 3 dots and Add term group

Error message
The first time I worked with the Term store in my tenant I got an error saying An unexpected error has occurred. Please try again later. - I thought that there might be some issues with Microsoft, until I found out that the error should say You are not a term store manager

Add yourself as an admin, and add a new term group again, and instead of an error message, your should get a success message

Start building your Term store in a tree structure - notice that the first name (the folder icon) is mainly for admin purpose in the Term store, or when adding your Term store/Managed metadata column.

In my example below, the user will only see Animals and the available options - so add one more level then what feels natural.

Don’t create your entire Term store set in one sitting, because you can’t drag and drop the options around.

Create the structure you want with 1 or 2 options, and then create the Managed metadata column in your list, and check out how it looks.

The Term store has options to copy, move, merge etc., but I think it depends on the situation - but don’t be afraid to fool around

What the users see
I have created a new list where people can choose their favorite animal

With Managed metadata, the users have a tree like experience - and the terms can be reused on all lists in the tenant

Filtering term store column in Power Automate

If we want the get a list of all the items with cats the natural thing would be to use the ODATA filter, and use internal name eq cats

internalname eq 'Cats'

Animals eq 'Cats'

But if we do that, then we get the following error

The field ‘Animals’ of type ‘TaxonomyFieldType’ cannot be used in the query filter expression.

Well that means it can’t be done? Or can it?

If we don’t care about any specific column (which I think is OK in most cases) we can use this expression in our ODATA filter (TaxCatchAll/Term)

TaxCatchAll/Term eq 'Cats'

This will return all items where Cats is selected (notice we did not write a specific column name, so it returns items from all columns, so if anyone had selected Cats in Animals or Animals2 that item would be returned)

We can take it even further
There is a hidden list named TaxonomyHiddenList with all of the information available in the Term store. We can get it by using the Get items action and in the List Name option, select Enter custom value and insert TaxonomyHiddenList

Note: The list is very big, so you should filter down the term you want. Here we are looking for anything with where Title eq Cats

Let’s take the first term ID that is available in the filtered list, by using this expression and insert it into a variable

outputs('Get_items_TaxonomyHiddenList')?['body/value'][0]?['IdForTerm']

Then we could filter our first Get items with the filter array

Single item

If you have a single item (Action: Get item) from a list - and would like to filter another list with that specific Term store ID - you can use TaxCatchAll/IdForTerm

TaxCatchAll/IdForTerm eq 'your-item-name/TermGuid'

Now you know how to work with the Term store, and how to filter in Power Automate.


See also