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

Announcements

News and Announcements icon
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

PA S03.PNG
PA S01.PNG
PA S02.PNG
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,752 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,963 Moderator 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
    155,752 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
    155,752 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

    PA S06.PNG
  • WarrenBelz Profile Picture
    155,752 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
    155,752 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard