Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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

  • Verified answer
    WarrenBelz Profile Picture
    148,648 Most Valuable Professional on at
    Re: How to filter data by clicking on the icon?

    @Niravajudia ,

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

  • Niravajudia Profile Picture
    14 on at
    Re: How to filter data by clicking on the icon?

    Absolutely amazing. 

     

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

  • WarrenBelz Profile Picture
    148,648 Most Valuable Professional on at
    Re: How to filter data by clicking on the icon?

    @Niravajudia ,

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

  • Niravajudia Profile Picture
    14 on at
    Re: How to filter data by clicking on the icon?

    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
    148,648 Most Valuable Professional on at
    Re: How to filter data by clicking on the icon?

    @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
    Re: How to filter data by clicking on the icon?

    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
    148,648 Most Valuable Professional on at
    Re: How to filter data by clicking on the icon?

    @Niravajudia ,

    It was missing a comma

  • Niravajudia Profile Picture
    14 on at
    Re: How to filter data by clicking on the icon?

    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

  • Michael E. Gernaey Profile Picture
    44,148 Super User 2025 Season 1 on at
    Re: How to filter data by clicking on the icon?

    @WarrenBelz that's certainly what it seems like.

  • WarrenBelz Profile Picture
    148,648 Most Valuable Professional on at
    Re: How to filter data by clicking on the icon?

    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

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1