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 / Need code for the Gallery
Power Apps
Answered

Need code for the Gallery

(0) ShareShare
ReportReport
Posted on by 1,066
Dear Experts,
I have a textbox called SearchBox and 2 comboboxes called cbDepartment and cbJobTitle for selecting Department en JobTitle.
I need code for the Gallery to react when a search is entered in the SearchBox or a department or jobtitle is selected in the comboboxes.
What is the code. Can someone please help. Gr. P
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    155,775 Most Valuable Professional on at
    I need to make a lot of assumptions here as you have not provided some necessary details. I am basing this on you using SharePoint as a data source, Department and JobTitle are Choice fields and you are using these choices in the Combo Boxes. You have also not stated the field you want to search with the search box.
    With(
       {
          _Data:
          Filter(
             SPListName,
             (
                Len(cbDepartment.Selected.Value) = 0 ||
                Department.Value = cbDepartment.Selected.Value
             ) &&
             (
                Len(cbJobTitle.Selected.Value) = 0 ||
                JobTitle.Value = cbJobTitle.Selected.Value
             )
          )
       },
       Search(
          _Data,
          SearchBox.Text,
          YourFieldToSearchHere
       )
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee
     
     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard