cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JonRetro
Frequent Visitor

Creating Search with filtered dropdown

How do I implement search within my PowerApp? I have a drop-down that filters the location, I want the search to look for the first name or last name, and status.

JonRetro_0-1654114365548.png

The browse gallery formula is: 

SortByColumns(
Filter(
[@'Leave Tracking'],
Campus = Dropdown1.Selected.Result,
StartsWith(
Title,
TextSearchBox1.Text
)
),
"Title",
If(
SortDescending1,
Descending,
Ascending
)
)

 

How do I add search function into there?

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @JonRetro ,

Try this (note I have assumed your field names and that they are all Single Lines of Text).

With(
   {
      wList:
      SortByColumns(
         Filter(
            'Leave Tracking',
            Campus = Dropdown1.Selected.Result
         ), 
         "Title",
         If(
            SortDescending1,
            Descending,
            Ascending
         )
      )
   },
   Search(
      wList,
      TextSearchBox1.Text,
      "First Name",
      "Last Name",
      "Status",
      "Title"
   )
)

 

Please click Accept as solution 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 Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

3 REPLIES 3
Drrickryp
Super User
Super User

@JonRetro 

With({somelist: Filter(
                        [@'Leave Tracking'], Campus = Dropdown1.Selected.Result
                  )
      },
       SortByColumns(
                      Search(
                             somelist, TextSearchBox1.Text, "Title","LastName",FirstName"
                       ), "Title", If(SortDescending1, Descending, Ascending)
        )
)
WarrenBelz
Super User
Super User

Hi @JonRetro ,

Try this (note I have assumed your field names and that they are all Single Lines of Text).

With(
   {
      wList:
      SortByColumns(
         Filter(
            'Leave Tracking',
            Campus = Dropdown1.Selected.Result
         ), 
         "Title",
         If(
            SortDescending1,
            Descending,
            Ascending
         )
      )
   },
   Search(
      wList,
      TextSearchBox1.Text,
      "First Name",
      "Last Name",
      "Status",
      "Title"
   )
)

 

Please click Accept as solution 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 Thumbs Up.

Visit my blog Practical Power Apps

bapala
Resolver IV
Resolver IV

.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,455)