web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sorting Power Apps Gal...
Power Apps
Answered

Sorting Power Apps Gallery using - Dataverse (Not SP)

(0) ShareShare
ReportReport
Posted on by 633

Hello All, 

 

Could you do me a favor? 

I'm trying to sort a gallery with Dataverse as a data source.

 

Sort Icon : 

UpdateContext({AppSortAscending: !AppSortAscending});
UpdateContext({SortColumn: "cr084_listprice"})
 
happyyear_0-1710177741354.png

 

Used the below code in gallery Items property:

Sort(
    If(
        GalleryTab.Selected.Value = "All",
        Filter(
            Shoe_Inventories,
            StartsWith(
                Text(ProductCategory),
                tbSearch.Text
            )
        ),
        Filter(
            Shoe_Inventories,
            StartsWith(
                Text(ProductCategory),
                tbSearch.Text
            ) && Text(ProductCategory) = GalleryTab.Selected.Value
        )
    ),
    If(
        AppSortAscending,
        SortOrder.Ascending,
        SortOrder.Descending
    )
)
 
happyyear_1-1710177789758.png

 

But nothing happened. Could you do me a favor? 

 

 

 

 

 

I have the same question (0)
  • ivan_apps Profile Picture
    2,189 Moderator on at

    Seems like you are missing your sort column before your sort order.

     

  • happyyear Profile Picture
    633 on at

    @ivan_apps Thank you for your comment. Could you please explain more? 

  • Verified answer
    AhmedSalih Profile Picture
    6,680 Moderator on at

    Hello, @happyyear what @ivan_apps meant is this:

    Sort(
     If(
     GalleryTab.Selected.Value = "All",
     Filter(
     Shoe_Inventories,
     StartsWith(
     Text(ProductCategory),
     tbSearch.Text
     )
     ),
     Filter(
     Shoe_Inventories,
     StartsWith(
     Text(ProductCategory),
     tbSearch.Text
     ) && Text(ProductCategory) = GalleryTab.Selected.Value
     )
     ),
    <COLUMN NAME HERE TO SORT BY, e.g Price, Category etc>
    ,
     If(
     AppSortAscending,
     SortOrder.Ascending,
     SortOrder.Descending
     )
    )

     


     

    If my reply helped you, please give a 👍 If it solved your issue, please give a 👍 & accept it as the Solution to help other community members find it more.

    Visit my Blog: ahmedsalih.blog

    Visit my YouTube Channel: https://www.youtube.com/@powerplatformplace/videos

  • happyyear Profile Picture
    633 on at

    @AhmedSalih Thank you. It is working well. 

    Sort(
        If(
            GalleryTab.Selected.Value = "All",
            Filter(
                Shoe_Inventories,
                StartsWith(
                    Text(ProductCategory),
                    tbSearch.Text
                )
            ),
            Filter(
                Shoe_Inventories,
                StartsWith(
                    Text(ProductCategory),
                    tbSearch.Text
                ) && Text(ProductCategory) = GalleryTab.Selected.Value
            )
        ),
        ListPrice,
        If(
            AppSortAscending,
            SortOrder.Ascending,
            SortOrder.Descending
        ))
  • ivan_apps Profile Picture
    2,189 Moderator on at

    Sorry for the late response, looks like you got it working now

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard