cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mkusler
Helper III
Helper III

Startswith Function Only Sorting on the First of Three Filter Criteria In My Gallery

I have a gallery that pulls in data from my SharePoint List if a record is in one of 3 different "Quote Status". From there I am attempting to give the user the ability to further search those results by  "ATI Freight PO#".

 

The problem is, my search function only works on the first "Quote Status" that I have in my code, which in this case is "In Transit".

 

Here is what I have in my Items Property, what am I doing wrong?

 

SortByColumns(Filter('Air Freight: Request & Tracking Log', (StartsWith('ATI Freight PO#', FreightPOSearchInput.Text)) && 'Quote Status'.Value = "In Transit" || 'Quote Status'.Value = "Pending Pickup" || 'Quote Status'.Value = "Quoting"),"Title", Descending)

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

@mkusler 

Your punctuation is messed up.  Try

SortByColumns(
         Filter(
                'Air Freight: Request & Tracking Log', 
                                StartsWith(
                                        'ATI Freight PO#', FreightPOSearchInput.Text
                                 ),
              Or(
                 'Quote Status'.Value = "In Transit",
                 'Quote Status'.Value = "Pending Pickup",
                 'Quote Status'.Value = "Quoting"
              )
           ),"Title", Descending
)

View solution in original post

5 REPLIES 5
Drrickryp
Super User
Super User

@mkusler 

Your punctuation is messed up.  Try

SortByColumns(
         Filter(
                'Air Freight: Request & Tracking Log', 
                                StartsWith(
                                        'ATI Freight PO#', FreightPOSearchInput.Text
                                 ),
              Or(
                 'Quote Status'.Value = "In Transit",
                 'Quote Status'.Value = "Pending Pickup",
                 'Quote Status'.Value = "Quoting"
              )
           ),"Title", Descending
)

Thank you so much! That worked perfectly. 

 

If in the future I wanted to add more "StartsWith" functions to give the user the ability to search by other criteria, is that possible or does having multiple functions like that cause confusion?

 

For example, if I wanted them to be able to search by "Quote #"? 

Drrickryp
Super User
Super User

@mkusler 

It is a bit more complicated but it can be done.  Think of it as starting will a big table and filtering it down to a smaller one using the "And" operator to add additional criteria.

Drrickryp
Super User
Super User

@mkusler 

It is a bit more complicated but it can be done.  Think of it as starting will a big table and filtering it down to a smaller one using the "And" operator to add additional criteria.

Awesome! I will see if I can figure it out on my own, now that I have a functioning gallery now.

 

Appreciate the proofreading! 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,024)