cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to use filer() and GruopBy in the app.

I am building an app that will group tools by model number and populate the combo box with Model number.

Once user chooses the model number from the drop down list, it will populate the Tools List Box (for that model only, one model many tools).

 

What I have done so far is added a data source that is SharePoint list. Then added a button and OnSelect I created the collection by this line of code ClearCollect(xyz,GroupBy(ToolsMasterVersion1,"ModelNumber","Name")) then set the combo box Items property to XYZ.

 

How can I populate the Tools list box with the "Name" for the selected tool from the drop down control?

 

Is there any better way to achieve this rather than use clearCollect and a command button? I tried to use ClearCollect onStart of screen but it is not allowed. ClearCollect working only with actionable control like button.

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: How to use filer() and GruopBy in the app.

If I understand your question at least part of it is answered by this video PowerApps Cascading Dropdown start there and then let me know if I can be of more help. 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

View solution in original post

Super User
Super User

Re: How to use filer() and GruopBy in the app.

If I'm understanding correctly I think you can get rid of the command button.  If you just want your Tool list box to only show tools that match the item number then you can set the Items property of your Tool List Box to be filtered according to the Model # Dropdown Value.  You would use the Distinct and Filter functions similar to the following:

 

Distinct(Filter(Tools,Model = ModelDD.Selected.Value),Tool)

 

So you would pass in the name of your data source first then you put in your filter condition (where model equals my selected model) and then tell it what field to return (tool name).

 

I made a blog post on this not too long ago that walks through this in more detail:

 

http://www.sharepointsiren.com/2018/03/cascading-dropdowns-in-powerapps.html

View solution in original post

5 REPLIES 5
Super User
Super User

Re: How to use filer() and GruopBy in the app.

If I understand your question at least part of it is answered by this video PowerApps Cascading Dropdown start there and then let me know if I can be of more help. 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

View solution in original post

Super User
Super User

Re: How to use filer() and GruopBy in the app.

If I'm understanding correctly I think you can get rid of the command button.  If you just want your Tool list box to only show tools that match the item number then you can set the Items property of your Tool List Box to be filtered according to the Model # Dropdown Value.  You would use the Distinct and Filter functions similar to the following:

 

Distinct(Filter(Tools,Model = ModelDD.Selected.Value),Tool)

 

So you would pass in the name of your data source first then you put in your filter condition (where model equals my selected model) and then tell it what field to return (tool name).

 

I made a blog post on this not too long ago that walks through this in more detail:

 

http://www.sharepointsiren.com/2018/03/cascading-dropdowns-in-powerapps.html

View solution in original post

Anonymous
Not applicable

Re: How to use filer() and GruopBy in the app.

Thanks to both of you. I will implement the solution and keep you posted. ShaneCows: I watch your video and it has been very useful in implementing the solution.
Anonymous
Not applicable

Re: How to use filer() and GruopBy in the app.

It worked just fine. Thanks to both of you. I might be back with more question if needed.
Super User
Super User

Re: How to use filer() and GruopBy in the app.

Glad to hear it worked!

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
Users Online
Currently online: 81 members 5,453 guests
Please welcome our newest community members: