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

Display data in gallery from two columns drawn from Combobox results

Hi all,

 

I'm looking for a little help here. 

 

I have a Combobox (named: MVPICombo1) that is drawing data from a table (named: ByProcedure) in a OneDrive excel file.

 

I also have a gallery (named: ByProcedureGallery) to display the results of the selected items in the combo box and have used the Distinct function to try and remove duplicates from both the combo box (which is filtering results by the column "CustomerName") and the gallery (which is displaying the values from the "Procedure" column for the results from the Combobox).  

 

However, I would like the gallery to show both the Procedure and CustomerName values in two fields in each gallery item but I think I am getting my code all mixed up as I cannot get it to do it.

 

I think it has to do with the Items code for the gallery which is:

 

Distinct( Filter(ByProcedure, CustomerName in MVPICombo1.SelectedItems.Result),Procedure)

 

 

Below are other codes to the relevant controls and some pics to help add context. 

 

- Field text label for each gallery item:

 

ThisItem.Result

 

- MVPICombo1 (combobox) Items:

 

Distinct( Filter(ByProcedure, Procedure=Procedure),CustomerName

 

 

Any help is appreciated. 

 

Thanks,

Joe

3 REPLIES 3
Highlighted
Super User III
Super User III

HI @JoeKermath 

To simplify the problem, create two tables from your original file that contain the Procedures and the Customer names.  Then use these in Dropdown or Combobox controls.  You can create forms to add new procedures and customers to these tables.  It seems to me that your app is flawed because it violates basic principles of database design.  Please look at my blog posts on how to do it. https://powerusers.microsoft.com/t5/News-Announcements/Database-Design-Fundamentals-and-PowerApps-An...  

Highlighted

Hi @Drrickryp,

 

Thank you very much for the help. I will have a good read through all your blog posts.

 

Quick question, I don't need my end users to add, edit, delete or refine any of the data in any way. This is purely a data viewing and filtering app to allow them to better use their data, e.g. view each procedure by the customer name. With that in mind, would you still recommend creating the two tables mentioned above? 

Highlighted

Hi @JoeKermath 

The normalization of your table won't affect the end users ability to search the data and will probably optimize the searches.  However, a poorly designed database will affect the developer's ability to add new records, make changes in existing records and remove records without affecting other records in the database. 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,080)