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 / Resetting Gallery filt...
Power Apps
Answered

Resetting Gallery filters display empty Gallery

(0) ShareShare
ReportReport
Posted on by 92

Hi all,

 

I have gallery which shows my SharePoint Data. When I filter the data in the gallery and then rest the filter controls, so that all data comes back, it doesn't do so.  All the data disappears and doesn't reappear again.

 

Can anyone please help with this, I would truly appreciate it.

 

Here are the Image of the Gallery:

Before any reset or filteringBefore any reset or filteringfiltered datafiltered data

 

 

 

 

 

 

 

 

 

After click on the reset buttonAfter click on the reset button

 

Codes:

Gallery's Default:

 

varRecord

 

Gallery's OnSelect :

 

Set(varRecord,ThisItem);
ClearCollect(colAccident,varRecord.'Type of Accident');
ClearCollect(colAnyTimeOff,varRecord.'Did the accident result in any time off work');
ClearCollect(colIncident,varRecord.'Type of Incident');
ClearCollect(colInjuriesSustained,varRecord.'Were any injuries sustained? If yes state nature of these injuries');
ClearCollect(colNear,varRecord.'Type of Near Miss');
ClearCollect(colTreatment,varRecord.'Any Treatment given ');
ClearCollect(colAddAttachment,varRecord.'Add an Attachment');
ClearCollect(colIssueForRepairs,varRecord.'Is this an issue for Repairs');
ClearCollect(colLineManager,varRecord.'Do any issue above concern their Line Manager');
ClearCollect(colRepairSuccess,varRecord.'Was the repair a success');
ClearCollect(colSuccessFulConclusion,varRecord.'Have all matters within the report reached a successfully conclusion');
ViewForm(Form1);Navigate(FormScreen);

 

Gallery's Item:

 

If(
 varDataCount < varDelegationLimit,
 SortByColumns( Filter(
 Filter(
 'Accident Form',
 (Status.Value = DrpStatus.Selected.Value || DrpStatus.Selected.Value = Blank()) && ('Please select the relevant option and continue to the next part'.Value = DrpIncident.Selected.Value || DrpIncident.Selected.Value = Blank())
 ),
 TxtSearch.Text in ID || TxtSearch.Text in Status.Value || TxtSearch.Text in 'Please select the relevant option and continue to the next part'.Value || TxtSearch.Text in Name.DisplayName || TxtSearch.Text in 'Date and time of accident'
 ), varSortColumn,varSortDirection),

 SortByColumns(Filter(
 'Accident Form',
 (Status.Value = DrpStatus.Selected.Value || DrpStatus.Selected.Value = Blank()) && ('Please select the relevant option and continue to the next part'.Value = DrpIncident.Selected.Value || DrpIncident.Selected.Value = Blank())
 ), 
 varSortColumn,varSortDirection)
)

 

Reset Button's OnSelect:

 

Reset(DrpStatus);Reset(DrpIncident);Reset(TxtSearch);

 

 

Categories:
I have the same question (0)
  • Sanshubh Profile Picture
    512 on at

    Hello @Teddy1 

    If you want to refresh Gallary's data then Write this Query

    Refresh(ListName)
  • Teddy1 Profile Picture
    92 on at

    Hi @SanshubhLubal 

    I have tried that, unfortunately it does not work.

  • Verified answer
    SebS Profile Picture
    4,824 Super User 2026 Season 1 on at

    @Teddy1 

     

    Try this code You need to handle Blanks of Fields hope I put it right

     

     

     

    If(
     varDataCount < varDelegationLimit,
     SortByColumns( Filter(
     Filter(
     'Accident Form',
     (IsBlank(DrpStatus.Selected.Value)||IsEmpty(DrpStatus.Selected.Value) && IsBlank(DrpIncident.Selected.Value) || IsEmpty(DrpIncident.Selected.Value)) || (Status.Value = DrpStatus.Selected.Value || DrpStatus.Selected.Value = Blank()) && ('Please select the relevant option and continue to the next part'.Value = DrpIncident.Selected.Value || DrpIncident.Selected.Value = Blank())
     ),
     IsBlank(TxtSearch.Text) || IsEmpty(TxtSearch.Text) || TxtSearch.Text in ID || TxtSearch.Text in Status.Value || TxtSearch.Text in 'Please select the relevant option and continue to the next part'.Value || TxtSearch.Text in Name.DisplayName || TxtSearch.Text in 'Date and time of accident'
     ), varSortColumn,varSortDirection),
    
     SortByColumns(Filter(
     'Accident Form',
     (IsBlank(DrpStatus.Selected.Value)||IsEmpty(DrpStatus.Selected.Value) && IsBlank(DrpIncident.Selected.Value) || IsEmpty(DrpIncident.Selected.Value)) || (Status.Value = DrpStatus.Selected.Value || DrpStatus.Selected.Value = Blank()) && ('Please select the relevant option and continue to the next part'.Value = DrpIncident.Selected.Value || DrpIncident.Selected.Value = Blank())
     ), 
     varSortColumn,varSortDirection)
    )

     

     

  • Teddy1 Profile Picture
    92 on at

    Hi @SebS thank you for your assistance. IT WORKED!!!!!

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 491

#2
WarrenBelz Profile Picture

WarrenBelz 407 Most Valuable Professional

#3
11manish Profile Picture

11manish 331

Last 30 days Overall leaderboard