web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to filter data by ...
Power Apps
Answered

How to filter data by clicking on the icon?

(0) ShareShare
ReportReport
Posted on by 14

Scenario: Clicking on the Shopping Cart Icon it should filter all items with the text "Order" in the column name called "Order".

 

Details: 

Name of the list: LS and Studio Spare

Gallery name: BrowseGallery1

The formula already has on "Items" in BrowseGallery 1 - 

SortByColumns( 

    Filter( 

        'LS and Studio Spare', 

        StartsWith(Title, TextSearchBox1.Text) || 

        StartsWith('Sub Title', TextSearchBox1.Text) || 

        StartsWith('Sec Loc', TextSearchBox1.Text) || 

        StartsWith('Ter Loc', TextSearchBox1.Text) || 

        StartsWith('Buy From', TextSearchBox1.Text) || 

        StartsWith('Pri Loc'.Value, TextSearchBox1.Text)|| 

        StartsWith(Order, TextSearchBox1.Text) 

    ), 

    "CreatedDate",  

       If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)

)

 

Thank you so much for your help

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    Hi @Niravajudia ,

    Is this what you mean ?

    SortByColumns( 
     Filter( 
     'LS and Studio Spare', 
     (
     StartsWith(Title, TextSearchBox1.Text) || 
     StartsWith('Sub Title', TextSearchBox1.Text) || 
     StartsWith('Sec Loc', TextSearchBox1.Text) || 
     StartsWith('Ter Loc', TextSearchBox1.Text) || 
     StartsWith('Buy From', TextSearchBox1.Text) || 
     StartsWith('Pri Loc'.Value, TextSearchBox1.Text) || 
     StartsWith(Order, TextSearchBox1.Text) 
     ) &&
     Order = "Order"
     ),
     "CreatedDate", 
     If(
     SortDescending1, 
     SortOrder.Descending, 
     SortOrder.Ascending
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Michael E. Gernaey Profile Picture
    53,429 Super User 2025 Season 2 on at

    @WarrenBelz that's certainly what it seems like.

  • Niravajudia Profile Picture
    14 on at

    Thanks, Warren. That seems perfectly correct, but I am getting an error. I don't know why exactly. 

    PA S04.PNG

     

    PA S05.PNG

     

    Thanks a lot

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    @Niravajudia ,

    It was missing a comma

  • Niravajudia Profile Picture
    14 on at

    Thanks, Warren. That's amazing. 

     

    But I can see all the "Order" items without clicking the Shopping Cart Icon. What OnSelect formula do I need to apply to the Shopping Cart Icon to make that happen?

     

    Thanks 

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    @Niravajudia ,

    Set a Variable on the Icon OnSelect

    UpdateContext({varOrder: true})

    at screen OnVisible or whenever you want to reset this

    UpdateContext({varOrder: false})

    then the Gallery Items

    SortByColumns( 
     Filter( 
     'LS and Studio Spare', 
     (
     StartsWith(Title, TextSearchBox1.Text) || 
     StartsWith('Sub Title', TextSearchBox1.Text) || 
     StartsWith('Sec Loc', TextSearchBox1.Text) || 
     StartsWith('Ter Loc', TextSearchBox1.Text) || 
     StartsWith('Buy From', TextSearchBox1.Text) || 
     StartsWith('Pri Loc'.Value, TextSearchBox1.Text) || 
     StartsWith(Order, TextSearchBox1.Text) 
     ) &&
     ( 
     !varOrder ||
     Order = "Order"
     )
     ),
     "CreatedDate", 
     If(
     SortDescending1, 
     SortOrder.Descending, 
     SortOrder.Ascending
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Niravajudia Profile Picture
    14 on at

    It worked. 😃

     

    Thanks a lot, Warren. Possibly the last thing I am having an issue with is with the reset properties. I am applying 

    UpdateContext({varOrder: false})​

    to my logo on the Onselect property, but I am receiving an error that Characters are used in an unexpected way. Is there a solution to this?

     

    Thanks a lot again

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    @Niravajudia ,

    Try typing it in - you have a strange hidden character at the end of your posted code

  • Niravajudia Profile Picture
    14 on at

    Absolutely amazing. 

     

    Thanks a lot, Warren. I can't thank you enough. 🙏

  • Verified answer
    WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    @Niravajudia ,

    Happy to help - I assume this is now solved and closed ?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard