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 / How to sort a gallery ...
Power Apps
Answered

How to sort a gallery on the value in a lookup field without using a collection

(0) ShareShare
ReportReport
Posted on by 664

I am trying to sort a gallery which shows meeting but sort the gallery on the organizer's last name which is a look up field to a different CDS entity. I know I could create a collection of all meetings, add the last name column, and modify the items property of the gallery to sort the collection, kind of like this

Ideally I do not want to redo collections because of other dependencies/rework required in the rest of the app. I have tried to combine AddColumns and SortByColumns like this but I haven't had much luck. The error is that the right side of the Equal must be a consistent value on AddColumns

 

SortByColumns(
 AddColumns(
 Filter(
 [@Meetings],
 Or(
 'Appointment Status Name' = "Completed",
 'Appointment Status Name' = "Cancelled"
 )
 ),
 "OrganizerLastName",
 Organizer.'Last Name'
 ),
 "OrganizerLastName", Ascending
)

 

Is it possible to sort on lookup value without a collection?

Categories:
I have the same question (0)
  • Verified answer
    Cooper01 Profile Picture
    664 on at

    I just closed and reopened my app and the error went away. Sort appears to be working properly as described in original post...?

  • eka24 Profile Picture
    20,925 on at
    This post may address your issue;
    https://powerusers.microsoft.com/t5/Common-Data-Service-for-Apps/SortByColums-Sort-a-LookUp-column/m-p/406574

    If you like this post, give a thumbs up. Where it solved your issue, Mark as a solution

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,074

#2
Valantis Profile Picture

Valantis 639

#3
11manish Profile Picture

11manish 606

Last 30 days Overall leaderboard