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

Comboboxes with filtered datasources

Hello,

 

I've been trying to implement a cascading flow between two comboboxes. One is connected to a list of "parent" values, the other containing a filtered list of "child" values with a reference to its corresponding parent value via lookup column.  This combobox should only contain choices tied to the parent values selected in a previous combobox.  The lists are set up as follows:image.png

 

image.png

 

However, whenever I place the following query into the subitem combobox the item collection returns empty or doesn't update from previous setting, while the same query seems to work for other controls such listboxes and dropdowns:

 

Filter(SubItemDemo, ParentItem.Value in ComboBox1.SelectedItems.Title)

 

image.png

In fact, the only filtering I can get working with the combobox is through simple compares with strings such as Title = "SubItem1".  Any time I use operators such as <>, "in", or anything else that throws a delegation warning it stops updating or fetching data.

 

Is there anything I'm missing here?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Comboboxes with filtered datasources

Hi @nnitrx,

 

I have made a test and the issue is confirmed on my side.

 

I agree with @Drrickryp's thought almost. You could consider take a try to save your two SP list data sources as two separated collections within your app, and then use the two collections as data source within the two Combo box controls.

 

I have made a test on my side, please take a try with the following workaround:6.JPG

 

 

Set the OnVisible property of the screen to following formula:

ClearCollect(ParentItemDemo,'20180811_case13_ParentItemDemo');
ClearCollect(SubItemDemo,'20180811_case13_SubItemDemo')

Note: The '20180811_case13_ParentItemDemo' represents the ParentItemDemo SP list on your side, the '20180811_case13_SubItemDemo' represents the SubItemDemo SP list on your side.

 

Set the Items property of the first Combo box control (ComboBox1) to following formula:

ParentItemDemo.Title

Set the Items property of the second Combo box control (ComboBox2) to following formula:

Filter(SubItemDemo,ParentItem.Value in ComboBox1.Selected.Title).Title

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Comboboxes with filtered datasources

Will it work if you create collections from your lists and use the collections as the datasources in the comboboxes instead of the original lists?  Delegation does not apply to collections and you are not limited to the usual arithmetic operators (=, etc).  Ref. https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-list

Community Support Team
Community Support Team

Re: Comboboxes with filtered datasources

Hi @nnitrx,

 

I have made a test and the issue is confirmed on my side.

 

I agree with @Drrickryp's thought almost. You could consider take a try to save your two SP list data sources as two separated collections within your app, and then use the two collections as data source within the two Combo box controls.

 

I have made a test on my side, please take a try with the following workaround:6.JPG

 

 

Set the OnVisible property of the screen to following formula:

ClearCollect(ParentItemDemo,'20180811_case13_ParentItemDemo');
ClearCollect(SubItemDemo,'20180811_case13_SubItemDemo')

Note: The '20180811_case13_ParentItemDemo' represents the ParentItemDemo SP list on your side, the '20180811_case13_SubItemDemo' represents the SubItemDemo SP list on your side.

 

Set the Items property of the first Combo box control (ComboBox1) to following formula:

ParentItemDemo.Title

Set the Items property of the second Combo box control (ComboBox2) to following formula:

Filter(SubItemDemo,ParentItem.Value in ComboBox1.Selected.Title).Title

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (5,246)