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 Apps
Answered

Sort number

(0) ShareShare
ReportReport
Posted on by 390

Good afternoon,

I have a gallery which I want to sort it by planned hours. I put this:

SortByColumns(
 Filter(
 SERVICIO;
 StartsWith(
 DESCRIPCIÓN;
 TextSearchServicio.Text
 );
Value("HORAS_x0020_PLANEADAS");
 If(
 Btn_OrdenarServicioHorasPlan;
 Ascending;
 Descending
 )
)

I put Value("Horas..."), but it returns an error that it requires Text type.

How can I fix it?

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,481 Most Valuable Professional on at

    Hi @JoseC12 

    Have you tried without the Value().

    If it already numeric, you do not need this.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Verified answer
    timl Profile Picture
    36,715 Super User 2026 Season 1 on at

    Hi @JoseC12 

    The SortByColumns requires us to pass a string column name.

     

    image.png

     

    In order to sort by a formula, we would use the Sort function rather than SortByColumns.

     

    Sort(
     Filter(
     SERVICIO;
     StartsWith(
     DESCRIPCIÓN;
     TextSearchServicio.Text
     );
    Value("HORAS_x0020_PLANEADAS");
     If(
     Btn_OrdenarServicioHorasPlan;
     Ascending;
     Descending
     )
    )

     

  • JoseC12 Profile Picture
    390 on at

    @timl 
    Alright it works, but how about if I want to sort twice or more in the same gallery, I mean not only sort hours, also title, or more columns. Thanks

  • WarrenBelz Profile Picture
    154,481 Most Valuable Professional on at

    @timl is correct on the bit missing - you should accept his solution.

    Have you solved your original error you referred to - I was focused on that in my response.

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard