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

Possibile to Add Columns and use Sort

So I am trying to make a pretty simple app that basically uses my current SQL sources. I am having an issue though in combining the 3 different tables together so my Gallery has info from the different spots AND then sorting and filtering that same list?  Is that possibile?

 

My data looks something like this:

Physicians | Name, ID, Phone

Physician Office | Address, Physician_ID, Office_ID

Contacts | Office_ID, SalesRep_ID

Reps | SalesRep_ID,  RepName

 

What I want to do is have a listing of the Physicians and then get all the way down to the RepName... to do that I need to hop through 3 tables and do matches as you see.. from searching through I found that on the ITEMS list I can add columns, which worked for one table, but not sure how to add the others. Then in addition I would then like to SORT and FILTER on that Items list.. so I am stuck. 1) I am unsure how to add more than one addcolumns to get results from multiple tables? 2) I am unsure how to addcolumns in the items area and then also add a sort and filter?

 

I think I am not in the right direction at all.. any help on what I am supposed to be doing to get these to work? Or am I supposed to be building a collection or using the Collection service for something like this instead?

 

Thanks for the help. New to the product.

1 REPLY 1
Community Support Team
Community Support Team

Re: Possibile to Add Columns and use Sort

Hi @ryanstokes,

 

Within PowerApps you could take use of Lookup() function to find the proper data through another table.

For example, if we have the proper record selected from the Physicians table from a Gallery1,

then to get the RepName, the formula should be:

Lookup(Reps,
        SalesRep_ID= Lookup(Contacts,
                          Office_ID= Lookup(Physician Office,
                                          Physician_ID=Gallery1.Selected.ID).Office_ID
                            ).SalesRep_ID
).RepName

To AddColumns within PowerApps, we need to take use of the AddColumns function, for more details, please see:

https://docs.microsoft.com/en-us/powerapps/functions/function-table-shaping

 

Some more readings:

https://docs.microsoft.com/en-us/powerapps/working-with-data-sources

https://docs.microsoft.com/en-us/powerapps/working-with-tables

 

Regards,

Michael

 

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

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 (4,954)