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 / Adding sort bottom.
Power Apps
Unanswered

Adding sort bottom.

(0) ShareShare
ReportReport
Posted on by 277

Hello guys,

 

I have this formula on mi Item's gallery property:

SortByColumns(Search(EmployeeDirectory,TextInput1.Text,"FullName"),
"Yjoined", Descending,
"Mjoined", Descending,
"Djoined", Descending
)

 

I want to add a sort bottom to order my gallery by FullName, so I added the bottom and OnSelect property I have this:

UpdateContext({varPersonSort: !varPersonSort})

 

So adding the feature I have this:

 If(!IsBlank(varPersonSort),
SortByColumns(
Search(EmployeeDirectory,TextInput1.Text,"FullName"),
"Yjoined", If(varPersonSort=true,Descending,Ascending),
"Mjoined", If(varPersonSort=true,Descending,Ascending),
"Djoined", If(varPersonSort=true,Descending,Ascending)
))

 

But is not working and I don't get why.

 

Any ideas?

 

Thank you in advance,

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @ADumith 

    First, you are specifying your context variable as a Boolean type and then trying to determine if it is blank or not.  This will show it to never be blank once assigned a value.

     

    What exactly are you trying to sort?  Are you stating that when Person sort is specified, it should sort by the full name and when NOT, then it would be by the dates?

  • ADumith Profile Picture
    277 on at

    Hello again Randy,

    Thanks for replying.

    In the Screen OnVisible property I declare the variable like this:
    UpdateContext({varPersonSort: Blank()})

    Then in the icon in the OnSelect property I have this:
    UpdateContext({varPersonSort: !varPersonSort})

    My goal is to be able to offer the user the possibility of sorting the collection by full name, keeping the critera that by default the collection is sorted by the fields YJoinned, MJoinned and DJoinned.

     

    That is, when the user clicks it is as if another sorting column (FullName) is added.

     

    Thank you again for your time.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @ADumith 

    Very good.  

    I guess what I am confused on is that you are specifying ascending or descending based on that variable in your formula.

    It seems to me that you are stating you want to sort by Full Name *in addition to* the other established sort, so how does the ascending descending fit into that?  Not getting the connection.

     

  • ADumith Profile Picture
    277 on at

    Hello,

     

    The collection has a pre-established order, which is year, month and day. This one has the following columns:

    Full Name, email, Birthday and Date of Hire.

     

    My idea is to give the user the option to order by full name.

     

    Keeping the original order.

     

    Thank you

  • ADumith Profile Picture
    277 on at

    Hello Sir,

     

    I'm still struggling with this.

     

    I wonder if you are available to assist me.

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 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard