cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Awad0367
Advocate I
Advocate I

sorting and filtering search based on 2 possible search columns in gallery

I am trying to search after 2 posssible columns 'RegNr' and 'Rekvistion Nummer'  gallery with sahrepint list  data source "Rekviistion"

 

I need to enter || function in the formula below 

SortByColumns(
Filter(Rekvisition; StartsWith('Reg.nr'; tbSearchRekv.Text)); "ID"; Descending)

 

 

like that

SortByColumns(
Filter(Rekvisition; StartsWith('Reg.nr'; || 'Rekvisition Nummer' ; tbSearchRekv.Text)); "ID"; Descending)

 

but it gives error . How can I adjust it 

1 ACCEPTED SOLUTION

Accepted Solutions
iAm_ManCat
Super User
Super User

I think something like this would work for your situation - we also should have a check there for when the text is blank so that we don't try filter when its blank:

 

 

SortByColumns(
   Filter(
      Rekvisition; 
      tbSearchRekv.Text=""
      ||
      (
         StartsWith('Rekvisition Nummer' ; tbSearchRekv.Text)
         ||
         StartsWith('Reg.nr'; tbSearchRekv.Text)
      )
   );
   "ID";
   Descending
)

 

 

@iAm_ManCat
My blog

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

3 REPLIES 3
iAm_ManCat
Super User
Super User

I think something like this would work for your situation - we also should have a check there for when the text is blank so that we don't try filter when its blank:

 

 

SortByColumns(
   Filter(
      Rekvisition; 
      tbSearchRekv.Text=""
      ||
      (
         StartsWith('Rekvisition Nummer' ; tbSearchRekv.Text)
         ||
         StartsWith('Reg.nr'; tbSearchRekv.Text)
      )
   );
   "ID";
   Descending
)

 

 

@iAm_ManCat
My blog

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Awad0367
Advocate I
Advocate I

It worked likea charm, Thanks for help.

Excellent, glad I could help!

@iAm_ManCat
My blog

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


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 (2,192)