The field of type taxonomyfieldtype cannot be used in the query filter expression in SharePoint Online visual studio workflow

This SharePoint tutorial, we will disucss, how to fix error The field <field name> of type taxonomyfieldtype cannot be used in the query filter expression. The error comes when we try to filter based on taxonomy field type in SharePoint Online visual studio 2015 workflow.

Recently we were working in a visual studio 2015 workflow for our SharePoint online site. In that workflow, we were trying to filter data from a SharePoint online list. We were filtering based on a taxonomy field type through Rest API by using a httpsend workflow activity. But it gave me an error like below:

“The field <field name> of type TaxonomyFieldType cannot be used in the query filter expression”. The error looks like below:

The field of type taxonomyfieldtype cannot be used in the query

The field <field name> of type taxonomyfieldtype cannot be used in the query filter expression

We were using the below URL:

https://oursite.sharepoint.com/sites/MyDev/_api/web/lists/getByTitle(‘ourlistname’)/items?$filter=FieldName eq Execution

The field <field name> of type taxonomyfieldtype cannot be used in the query filter expression

We can not filter based on the taxonomy field like above. So we can write like below:

Here we have used 3 variable inside our workflow:

  • currentWebUri: This will give the current site URL.
  • ourListGuid: This will give our current list guid
  • CurrentItemTaxonolyFieldWssId: This will give the WssId of the column which we want to use in the filter condition.

We have to use CAML like below:

currentWebUri + "_api/lists(guid\'" + ourListGuid + "\’)/GetItems([email protected])[email protected]={\"ViewXml\":\"<View%20Scope=\’RecursiveAll\’><RowLimit>1</RowLimit><Query><Where><Eq><FieldRef%20Name=\’FieldName\’%20LookupId=\’True\’/><Value%20Type=\’Integer\’>" + CurrentItemTaxonolyFieldWssId + "</Value></Eq></Where></Query></View>\"}"

If you are using inside a visual studio 2015 workflow using httpsend activitity make sure to use this as a POST request rather than a Get request.

You may like following SharePoint tutorials:

This SharePoint tutorial helps us to solve an error The field <field name> of type TaxonomyFieldType cannot be used in the query filter expression.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>