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

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Help: Creating Gallery based on Lookup field

(0) ShareShare
ReportReport
Posted on by

Hi everyone, this one has really bugged me and I really would like someone to put me out of my misery. Scenario: I have two SharePoint lists, one called Client List and one called Client Deals. In Client Deals I have a look up column called 'Client Name:' and this field points to the single line of text field in Client List called 'Client Name:' . The issue I am having is I cannot return a gallery list in PowerApps using the data Client Deals, which I want to be able to do so deal status can be updated on the fly.

The following code should work, it does if I replace 'Client Deals' with 'Client List'. What am I doing wrong/ missed, please?

SortByColumns(Filter('Client Deals', StartsWith('Client Name:', TextSearchBox1_1.Text)), "ClientName", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))

 

I have the same question (0)
  • BoHamad Profile Picture
    on at
    Re: Help: Creating Gallery based on Lookup field

    hi @shayhurst 

     

    i thought if you want to use a look up column you should use .value or .id after the name of the col For Ex.

    SortByColumns(Filter('Client Deals', StartsWith('Client Name:', TextSearchBox1_1.Text)), "ClientName".Value, If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))

     

    hope this help

    Best Regards,

  • shayhurst Profile Picture
    on at
    Re: Help: Creating Gallery based on Lookup field

    Thanks for the advice. Still didn't work, I am afraidScreenshot 2023-08-04 at 09.40.00.png. Also changed the second column name to "Client Name:" as this is how it is set out in the SharePointList. The issue is the lookup column and I cannot find anything specific to help.

    SortByColumns(Filter('Client Deals', StartsWith('Client Name:', TextSearchBox1_1.Text)), "Client Name:".Value, If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))

  • shayhurst Profile Picture
    on at
    Re: Help: Creating Gallery based on Lookup field

    Help states..Screenshot 2023-08-04 at 09.41.57.png

  • BoHamad Profile Picture
    on at
    Re: Help: Creating Gallery based on Lookup field

    Uset Sort insted of SortByColumns

     

     

    Sort(Filter('Client Deals', StartsWith(ClientName.Value, TextSearchBox1_1.Text)), ClientName.Value, If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))

     

     

     

    Hope This help

  • shayhurst Profile Picture
    on at
    Re: Help: Creating Gallery based on Lookup field

    Hi, appreciate the help but I am afraid not. Same error. 

  • shayhurst Profile Picture
    on at
    Re: Help: Creating Gallery based on Lookup field

    Ok, so I have read that spaces in a lookup field name are bad. When I removed the spaces I managed to get the gallary returning results, except for the lookup field 'ClientName:'. The error now reads, Screenshot 2023-08-04 at 10.37.02.png

  • Verified answer
    shayhurst Profile Picture
    on at
    Re: Help: Creating Gallery based on Lookup field

    Ok, I have solved it with the help of a Shane Young YouTube video. The ClientName field needed to read, ThisItem.'ClientName:'.Value as it is a lookup field. 😅 🙌

     

    https://www.youtube.com/watch?v=G4pWRzzCDAM 

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 624 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 381 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 225

Last 30 days Overall leaderboard