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

replace heading column to dropdown in table

Hello everyone, I wanted to ask
There is a tableCapture.JPG, is it possible to replace the column heading with a drop-down menu in order to further sort the display in the table by the column heading for example.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: replace heading column to dropdown in table

HI @Anonymous ,

Do you want to calculate the Total value based on the Dropdown menu?

 

Based on the needs that you mentioned, I think the Sum function could achieve your needs. Please consider set the Text property of the corresponding Label under the Gallery to following:

Sum(Gallery1.AllItems, UAH)
Sum(Gallery1.AllItems, USD)
Sum(Gallery1.AllItems, EUR)

...

...

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

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

5 REPLIES 5
Highlighted
Super User III
Super User III

Re: replace heading column to dropdown in table

@Anonymous 

You can accomplish this by placing an Icon beside the column name.

 

aaa.PNG

 

Put this code in the OnVisible property of the screen

 

Set(mySort,{ColumnName:"FirstName",Order:Ascending})

 

Put this code in the Items property of the Data Table

 

SortByColumns(NamesList,mySort.ColumnName,If(mySort.Order="Ascending",Ascending,Descending))

 

Put this code in the OnSelect property of the FirstName sort icon

 

If(
    mySort.ColumnName="FirstName",
    If(mySort.Order="Ascending",Set(mySort,{ColumnName:"FirstName",Order:"Descending"}),Set(mySort,{ColumnName:"FirstName",Order:"Ascending"})),
    Set(mySort,{ColumnName:"FirstName",Order:Ascending})
)

 

Now when you click the icon beside the FirstName column header it will change the sort.  Repeat this step for each sort icon.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Anonymous
Not applicable

Re: replace heading column to dropdown in table

Thanks for your advice, but that’s not exactly what I need. Below there are total cells. And I would like to choose by the name of the company and transaction to configure that the total data would be displayed in the total after sorting

Highlighted
Community Support
Community Support

Re: replace heading column to dropdown in table

Hi @Anonymous ,

Could you please share a bit more about your scenario?

Do you want to replace the Data Table column heading with a Dropdown box consists of available column names?

 

If you want to  replace the Data Table column heading with a Dropdown box consists of available column names, I afraid that there is no way to achieve your needs in PowerApps currently.

Currently, we could not add a Dropdown control into a Data Table control directly. As an alternative solution, I think you could consider configure a Gallery to list all your data source records, then add several Dropdown controls to act as Column header for these columns which you want to configure Column haeding as Dropdown menu.

 

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

1.JPG

Set the Items property of the Gallery to following:

Sort(
  Sort(
      Sort(
           'YourDataSource', 
            If(
               Dropdown2.Sleected.Value = "Title", Title, 
               Dropdown2.Sleected.Value = "Status", Status, 
               Dropdown2.Sleected.Value = "Project", Project, 
               Dropdown2.Sleected.Value = "Price", Price
            ), 
            Descending
       ),
      If(
         Dropdown2.Sleected.Value = "Title", Title, 
         Dropdown2.Sleected.Value = "Status", Status, 
         Dropdown2.Sleected.Value = "Project", Project, 
         Dropdown2.Sleected.Value = "Price", Price
      ),
      Descending
    ),
    If(
        Dropdown3.Sleected.Value = "Title", Title, 
        Dropdown3.Sleected.Value = "Status", Status, 
        Dropdown3.Sleected.Value = "Project", Project, 
        Dropdown3.Sleected.Value = "Price", Price
     ),
    Descending
) 

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

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.
Highlighted
Anonymous
Not applicable

Re: replace heading column to dropdown in table

This is a good solution, but it doesn’t work out for me to set up sorting and summing with it, for example, having drop-down menus, companies, a transaction, and cache boxing does not work when I select from these menus to automatically sum the currency columns into total cells.Capture.JPG

Highlighted
Community Support
Community Support

Re: replace heading column to dropdown in table

HI @Anonymous ,

Do you want to calculate the Total value based on the Dropdown menu?

 

Based on the needs that you mentioned, I think the Sum function could achieve your needs. Please consider set the Text property of the corresponding Label under the Gallery to following:

Sum(Gallery1.AllItems, UAH)
Sum(Gallery1.AllItems, USD)
Sum(Gallery1.AllItems, EUR)

...

...

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,494)