cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marcy_pi
Helper II
Helper II

Update gallery with button click to show all items

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 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

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

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

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

marcy_pi
Helper II
Helper II

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? 

@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

 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (69)