cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AidanHarris
New Member

Filtering using ComboBox

I have a canvas app that contains two lookup fields.

 

1st field is a lookup to a dataverse table, this table contains a combobox with three possible values.

 

2nd field I need to filter based on the values of the ComboBox in the first field, is this possible?

 

When I use 'Depends On' I can select the parent control but the ComboBox isn't available under that, I can add it to the formula and then select Value but it's saying I can't compare Text and Table.

 

Is there a way I can grab the text values of the selected ComboBox values in order to filter?

 

1 ACCEPTED SOLUTION

Accepted Solutions
EricRegnier
Super User
Super User

Hi @AidanHarris,

You can achieve this by setting the the Items property of the dependent combo box based on the selected item of the parent combo box. Here's an example:

EricRegnier_0-1640899945390.png

Hope this helps!

View solution in original post

8 REPLIES 8
CNT
Super User
Super User

@AidanHarris Could you please provide the Data Type of these 2 fields in Dataverse (A screen shot would be great)

EricRegnier
Super User
Super User

Hi @AidanHarris,

You can achieve this by setting the the Items property of the dependent combo box based on the selected item of the parent combo box. Here's an example:

EricRegnier_0-1640899945390.png

Hope this helps!

Hi,

I have the exact same issue which I have been trying to fix for several days. I have tried your formula but after I choose an Account from ComboBox 1, all of the records in ComboBox 2 are returned, they do not filter.

Any other suggestions please?

Can you share the 2 formulas of the 2 combo boxes please?

ComboBox1 Items: Accounts   (The table that it selects from)

Display and Search Fields: ["name"]  (Which is the logial name of Accounts Name)

 

ComboBox2 Items: Filter(Systems, 'Site Name' = ComboBox1.Selected.'Account Name')

Display and Search Fields: ["cre0b_sitename"] (The logical name of Site Name within Table 'Systems' where I want the site name of systems to filter based on the account they are associated with)

ComboBox1 Items: Accounts   (The table that it selects from)

Display and Search Fields: ["name"]  (Which is the logial name of Accounts Name)

 

ComboBox2 Items: Filter(Systems, 'Site Name' = ComboBox1.Selected.'Account Name')

Display and Search Fields: ["cre0b_sitename"] (The logical name of Site Name within Table 'Systems' where I want the site name of systems to filter based on the account they are associated with)

Hey @Neil_ODonnell, did you get this working finally? At a glace the formulas look right. And I assume you double checked that Site Name is indeed the same as Account Name and there's only one Site Name column in the table? Also, another thing to try is instead of having a soft relationship with Account Name text, have a lookup column from Systems to Account, and then filter by that lookup column. That will enforce integrity. Hope this helps!

Neil_ODonnell
Frequent Visitor

Yes @EricRegnier  i got it working thanks

 

Combobox2 Items:

SortByColumns(Accounts,"name")

 

Combobox3 Items:

SortByColumns(
Filter(Sites, Account.'Account Name' = ComboBox2.Selected.'Account Name'),"cre0b_name")

 

 

where "Account'.Account Name" is my Account Table Name field and is selected first within Combobox2

and "cre0b_name" is from the "Sites" Table that is then filtered and selected within Combobox3

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Users online (3,343)