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

Community site session details

Session Id : yo26qFd7tHovKuw1OtykMQ
Power Apps - Building Power Apps
Answered

Update gallery with button click to show all items

Like (0) ShareShare
ReportReport
Posted on 29 Jun 2022 14:51:32 by 158

Hello,

 

I have a gallery which is taking data from another gallery: 1st gallery is months only and second gallery are items per month. I already have a button to filter the gallery with items through the value and it's working but I want another button which will show me all items per selected month back(not only above £50). 

 

My codes:

Gallery with items: 

Filter(
Table1,
(month='Month Gallery'.Selected.month),
If(
FilterByValue = true, 'ALL SCRAP COST'>=50)
)

 

My button to filter gallery through the value:

UpdateContext({FilterByValue:!FilterByValue})

 

What do I need to add to the gallery and another button to show me all scrap values, not only these above £50, please? 

 

Regards 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    150,995 Most Valuable Professional on 29 Jun 2022 at 21:08:57
    Re: Update gallery with button click to show all items

    Hi @marcy_pi ,

    This will show either, depending on your button sequence

    Filter(
     Table1,
     month='Month Gallery'.Selected.month &&
     (
     !FilterByValue ||
     'ALL SCRAP COST'>=50
     )
    )

     

     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.

    Visit my blog Practical Power Apps

  • MP-13011217-0 Profile Picture
    158 on 30 Jun 2022 at 07:52:16
    Re: Update gallery with button click to show all items

    Thank You this is working very well! Do You know how I can do the same but use 2 buttons: 1st to show these values above 50 and another button to show all values? 

     

    The code You shown is great but working for one button so I click and it shows my values then I click again and it shows all records. How to split these two operations to two buttons? 

  • WarrenBelz Profile Picture
    150,995 Most Valuable Professional on 30 Jun 2022 at 10:35:46
    Re: Update gallery with button click to show all items

    @marcy_pi ,

    For the two buttons, just have one setting the Variable to true and the other setting it to false.

    For the value, set a Variable

     

    UpdateContext({varOver50: true})

     

    and the other

     

    UpdateContext({varOver50: false})

    and I cannot test this and have tried to keep it Delegable

    Filter(
     Table1,
     month = 'Month Gallery'.Selected.month &&
     (
     !FilterByValue ||
     (
     (
     varOver50 || 
     'ALL SCRAP COST' >=50
     ) &&
     (
     !varOver50 ||		 
     'ALL SCRAP COST' < 50
     )		 
     )
     )
    )
    

     

    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.

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 752 Most Valuable Professional

#2
developerAJ Profile Picture

developerAJ 472

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 358 Super User 2025 Season 2

Last 30 days Overall leaderboard