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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (5,959)