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


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


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


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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

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