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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Can't use ThisItem in ...
Power Apps
Unanswered

Can't use ThisItem in LookUp within Sort

(0) ShareShare
ReportReport
Posted on by 65

The following works fine to add text to a label in a gallery: 

LookUp(RemoteTable,proposal_no=ThisItem.proposal_no,name)

But as soon as I nest that within a Sort function, I can't use the ThisItem anymore (it gets the red squiggle). This is what I want to do:

Sort(If(ActiveToggle.Value=true,Filter(collection,date<Today() && Today() <date),collection),LookUp(RemoteTable,proposal_no=ThisItem.proposal_no,name))

If I just use proposal_no=proposal_no, it returns the same result for every record and doesn't sort right.

 

Any help?

 

Thanks!

Categories:
I have the same question (0)
  • Verified answer
    v-yutliu-msft Profile Picture
    on at

    Hi @kman42 ,

    The funtion of Sort is used to sort a table.

    I'm afraid it's not supported to use it to sort some labels currently.

    If you want to sort the gallery according to the name column, I suggest tou set the gallery's Items:

    Sort(If(ActiveToggle.Value=true,Filter(collection,date<Today() && Today() <date),collection),name)

    Here's a doc about Sort for your reference:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-sort

     

     

    Best regards,

    Community Support Team _ Phoebe Liu

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 759 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 310 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 228

Last 30 days Overall leaderboard