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 / Searching a lookup fie...
Power Apps
Unanswered

Searching a lookup field in Gallery using the Search Text Box

(0) ShareShare
ReportReport
Posted on by 356

Hi Pro's

 

Been struggling to be able to use the search function on a gallery which references a lookup field.

@RandyHayes you basically solved this for me in terms of searching the whole string of text elsewhere in the app using :

ForAll(Choices(yourList.yourLookupColumn), {Id: Id, Value: Value})

 I hope you can provide close to the solution in terms of searching on the gallery ? I placed that above in the gallery ITEMS field but the output was not what i expected although it took it..it returned some wierdness. 

Ultimately again i need to search with the site name to return the gallery item related to the site name.

Lasherza_0-1661333342462.png

Items property of the gallery was OOB and works in returning data but i suspect not correct for my purpose.

 

Thanks!

I

Categories:
I have the same question (0)
  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    Hi,

     

    The formula for the Items property is like this: Search ( YourTable, SearchTextInput.Text, "column_logicalname" )

  • Lasherza Profile Picture
    356 on at

    Thanks but not exactly what im trying to achieve... Sorry i think i may have moved the goalposts here..

    I've now added a ComboBox - using the Search functionality within from @RandyHayes ..

    ForAll(Choices(yourList.yourLookupColumn), {Id: Id, Value: Value})

    Im now trying to use this tied to my gallery to filter...

     

    Currently in Items property on Gallery i have:

    Filter('Vandalism and Insurance List','Submitted to Finance'.Value=Dropdown2.SelectedText.Value || Dropdown2.Selected.Value=Blank() && Site.Value=ComboBox2.Selected.Value)

    Lasherza_0-1661338044884.png

    Combo Box not Filtering though.....

     

    Hope i haven't confused this too much....

    Thanks.

     

     

     

  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    Check your combobox to see if it allows for multiple selections. If it does, you cannot use Selected.Value.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Lasherza 

    The problem is that your formula is not providing the level of precedence for your AND's and OR's.

    You need to provide a clearer separation so that the formula works as intended.

     

    Please consider changing your Formula to the following:

    Filter('Vandalism and Insurance List',
     ('Submitted to Finance'.Value=Dropdown2.Selected.Value || IsBlank(Dropdown2.Selected.Value)) && 
     Site.Value=ComboBox2.Selected.Value
    )

     This will ensure that the OR is between the two conditions first, and then it is all AND'ed with the next result.

     

    Also, you had SelectedText in your formula...avoid using that property as it is listed as deprecated. 

     

    I hope this is helpful for you.

  • Lasherza Profile Picture
    356 on at

    Thanks @RandyHayes that pretty much is it.. Just one issue ... When the Site ComboBox filter is "empty"  it should bring back all sites where = to the second filter of Submitted to finance? Which it is not doing..

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard