Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Help: Creating Gallery based on Lookup field

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))

 

  • Verified answer
    shayhurst Profile Picture
    shayhurst 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 

  • shayhurst Profile Picture
    shayhurst 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

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

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

  • BoHamad Profile Picture
    BoHamad 87 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
    shayhurst on at
    Re: Help: Creating Gallery based on Lookup field

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

  • shayhurst Profile Picture
    shayhurst 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))

  • BoHamad Profile Picture
    BoHamad 87 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,

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,246

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,884

Leaderboard