cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jasirqadri123
Helper I
Helper I

Gallery is not refreshing and resetting to default

Hi Everyone,

 

I had tried to use reset(gallery),Reset(dropdown) to reset the galllery and dropdown to default .On clicking the button,dropdown is getting reset to default "ALL" which I have set but records disappear in gallery.

 

Dropdown used:

Onchange: If(Dropdown.SelectedText.Value = "ALL",Set(sortAll,false),Set(sortAll,true))

Items: ["ALL","New","Received"]

Default: "ALL"

 

What changes I have to do, to get all data records when I click reset button.

 

7 REPLIES 7
v-jefferni
Community Support
Community Support

Hi @jasirqadri123 ,

 

To be clear, Galleries cannot be "reset" but items will refreshing every time the Items property getting changed, e.g. the result of a filter criteria changes.

 

So, on your end, if you would like to display all items in the Gallery when Dropdown selected value is "ALL", please try below approach:

1. Dropdown:

Items: ["ALL","New","Received"]

Default: "ALL"

 

2. Gallery:

Items:

Filter(YourDataSource, If(Dropdown.Selected.Value = "ALL", true, Column.Value = Dropdown.Selected.Value))

 

3. Reset button:

Reset(Dropdown)

 

Hope this helps.

 

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

jasirqadri123
Helper I
Helper I

All is already working , I need to get ALL by default when I log in the app.

Hi @jasirqadri123 ,

 

My formula in the previous post should work for the All by default when opening the App. Have you tied it and how is it going now?

 

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

jasirqadri123
Helper I
Helper I

SortByColumns(If(sortAll,Filter(RepairOrderTables,Status = Dropdown.Selected.Value && Site = varsite.Site && (If(techAll,Technician = Dropdown1.SelectedText.Value,Site = varsite.Site))),Filter(RepairOrderTables,Site = varsite.Site && (If(techAll,Technician = Dropdown1.SelectedText.Value,Site = varsite.Site,If(!IsBlank(DatePickerStart.SelectedDate) && DatePickerStart.SelectedDate <= DatePicker.SelectedDate,OrderDate <= DatePicker.SelectedDate && OrderDate >= DatePickerStart.SelectedDate,OrderDate <= DatePicker.SelectedDate))))),"OrderDate",If(SortDescending1,Ascending,Descending),"OrderId",Descending)

 

This is formula on my gallery where i have four dropdowns .I need by default 'ALL' to show in Dropdown

 

Dropdown settings for given :

Dropdown used:

Onchange: If(Dropdown1.SelectedText.Value = "ALL",Set(techAll,false),Set(techAll,true))

Items: Tech

Onselect: ClearCollect(Tech,Distinct(RepairOrderTables_1,Technician));Collect(Tech,{Result:"ALL"});

Default: "All"

 

 

Hi @jasirqadri123 ,

 

The logic for the Items of Gallery is too complicated. Please try and put the tech condition on the top level:

With(
     {techSelected: Filter(RepairOrderTables,If(Dropdown1.Selected.Value = "ALL", true, Technician = Dropdown1.Selected.Value))},
     SortByColumns(
        Filter(
          techSelected,Status = Dropdown.Selected.Value && Site = varsite.Site && 
          If(
             !IsBlank(DatePickerStart.SelectedDate) && DatePickerStart.SelectedDate <= DatePicker.SelectedDate,
             OrderDate <= DatePicker.SelectedDate && OrderDate>= DatePickerStart.SelectedDate,
             OrderDate <= DatePicker.SelectedDate
          )
       ),
       "OrderDate",
       If(SortDescending1,Ascending,Descending),
       "OrderId",
       Descending
)
)

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

jasirqadri123
Helper I
Helper I

I cannot change my original formula as it is already filtering and giving the dropdown values .only missing thing is ALL is not displayed in dropdown when I log in app but all records are shown.

Hi @jasirqadri123 ,

 

Showing ALL items should be one of the conditions that filtering in a Gallery. You can add another Gallery beside the previous one, copy and paste my formula to its Items property then adjust to make it work, and check if the formula could help you to achieve your goal.

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

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 (4,045)