cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AdamH
Post Patron
Post Patron

Search not working

Hi All,

 

Can anyone tell me why my search function is not working?

 

 

With(
     {codes: SortByColumns(
                            Filter(
                                    [@'NC Codes'], StartsWith(
                                                             'Location of Coded Lock', 
                                                              TextSearchBox1.Text
                                                     ) 
                                                         && !'Manager Code'
                                                         && !'Paramedic Code'
                               ), "Title", If(
                                               SortDescending1,Descending,Ascending
                                            )
              )
       },

  Filter([@'NC Codes'], Locality = Gallery1.Selected.Value && ! 'Manager Code' && !'Paramedic Code'
  )
)

 

 

My filter gallery is working ok - but when I type a 'location of coded lock' in to the text search field, nothing happens. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
BCLS776
Super User
Super User

The Filter() at the end of your code doesn't include a reference to the set of records defined by your With() called "codes", and then it appears to duplicate the filtering by Manager Code and Paramedic Code.

Should it look more like:

With(
     {codes: SortByColumns(
                            Filter(
                                    [@'NC Codes'], StartsWith(
                                                             'Location of Coded Lock', 
                                                              TextSearchBox1.Text
                                                     ) 
                                                         && !'Manager Code'
                                                         && !'Paramedic Code'
                               ), "Title", If(
                                               SortDescending1,Descending,Ascending
                                            )
              )
       },

  Filter(codes, Locality = Gallery1.Selected.Value)
)
_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

1 REPLY 1
BCLS776
Super User
Super User

The Filter() at the end of your code doesn't include a reference to the set of records defined by your With() called "codes", and then it appears to duplicate the filtering by Manager Code and Paramedic Code.

Should it look more like:

With(
     {codes: SortByColumns(
                            Filter(
                                    [@'NC Codes'], StartsWith(
                                                             'Location of Coded Lock', 
                                                              TextSearchBox1.Text
                                                     ) 
                                                         && !'Manager Code'
                                                         && !'Paramedic Code'
                               ), "Title", If(
                                               SortDescending1,Descending,Ascending
                                            )
              )
       },

  Filter(codes, Locality = Gallery1.Selected.Value)
)
_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,776)