cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JoeFox79
Level: Powered On

Filtering Drop Down control using a SharePoint Managed Metadata column

Hi,

 

I'm having some trouble filtering a drop down control using a the value selected in another drop down control which is linked to a SharePoint Managed Metadata column.

 

Scenario:

I have a SharePoint list called 'Projects' with three columns:

  1. Client (Managed Metadata, column internal name is 'Client')
  2. Project Name (Text, column internal name is 'Title')
  3. ProjectTask (Text, column internal name is 'ProjectTask')

A Client has many Projects, and a Project has many Project Tasks.

 

What I want to achieve is effectively a cascading drop down mechanism using three drop down controls, so when the 'Client' is picked in the first drop down control, only the corresponding 'Project Name' data appears in the second drop down control, and when a 'Project Name' is selected from the second drop down control, only the corresponding 'ProjectsTask' data appears in the third drop down control.

 

If I used text for each column I can get it all to work but as the 'Client' data is stored in the Term Store (and therefore surfaced in the list via a managed metadata column), I'm having problems.

 

The 'Client' drop down control is called 'Client_Dropdown' and has the following formula for the 'Items' property:

 

Sort(Choices(Projects.Client),Value)

 

This works fine, returning the values within the 'Client' term set in alphabetical order.

 

The 'Project' drop down control has the following formula:

 

Filter(Projects,Client=Client_Dropdown.Selected.Value)

 

This throws an error at the = symbol that reads: "Invalid argument type".

 

It's frustrating me that I can't work out why this is happening.

If I switch to a different site column that uses plain text to represent the 'Client', it all works fine so I can only assume the issue is with the column type.

 

I wonder if anyone has been in a similar situation and managed to solve the problem.

Thanks,

Joe

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Filtering Drop Down control using a SharePoint Managed Metadata column

@JoeFox79 

Your issue is that you are trying to do a filter on a Managed Metadata column and treating it like it is just text...it's not.

    Filter(Projects,Client=Client_Dropdown.Selected.Value)  <== Client is a MMd column, not text - thus invalid.

 

The answer will depend on how you have your column configured.  If it is a simple setup where it does not allow multiple values and it is using the term store name as its value, then your formula will be this:

    Filter(Projects,Client.Label=Client_Dropdown.Selected.Value)

 

If it is not that simple of a setup on the column, you might need to do more.  If you look at the column in PowerApps, you will see that it has several properties on it - one of which, in this case to use, is the Label property.  Others may be needed in your solution based on your column setup.

 

Hope this helps some.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Filtering Drop Down control using a SharePoint Managed Metadata column

@JoeFox79 

Your issue is that you are trying to do a filter on a Managed Metadata column and treating it like it is just text...it's not.

    Filter(Projects,Client=Client_Dropdown.Selected.Value)  <== Client is a MMd column, not text - thus invalid.

 

The answer will depend on how you have your column configured.  If it is a simple setup where it does not allow multiple values and it is using the term store name as its value, then your formula will be this:

    Filter(Projects,Client.Label=Client_Dropdown.Selected.Value)

 

If it is not that simple of a setup on the column, you might need to do more.  If you look at the column in PowerApps, you will see that it has several properties on it - one of which, in this case to use, is the Label property.  Others may be needed in your solution based on your column setup.

 

Hope this helps some.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

JoeFox79
Level: Powered On

Re: Filtering Drop Down control using a SharePoint Managed Metadata column

Thanks @RandyHayes - knowing about the Client.label part has helped me resolve this.

One other thing I needed to do was to wrap the filter with a Distinct function so that only the relevant project names were returned.

 

Here is my final formula:

 

Distinct(Filter(Projects,Client.Label=Client_Dropdown.Selected.Value),'Project Name')

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,273)