cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Cooper01
Level: Powered On

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

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Cooper01
Level: Powered On

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

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

View solution in original post

2 REPLIES 2
Cooper01
Level: Powered On

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

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

View solution in original post

eka24
Level 10

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

This post may address your issue;
https://powerusers.microsoft.com/t5/Common-Data-Service-for-Apps/SortByColums-Sort-a-LookUp-column/m...

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

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,145)