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 / ClearCollect method to...
Power Apps
Answered

ClearCollect method to populate gallery and allow search via Textbox; gallery doesn't refresh automatically

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

There is a text box in my application and onSelect the following piece is executed : 

 

 

 

Refresh('ListName');
ClearCollect(GalleryData,
Filter('ListName', StartsWith(ColumnName.DisplayName, TextBoxName.Text)));

 

 

 

Now the gallery itself take data from GalleryData 

 

 

 

Filter(GalleryData, ColumName.Value = "SomeString")

 

 

 

The idea is to provide a gallery with searchbox feature which works on one of the columns, and a filter is there on top of it in the gallery which omits a few records based on value in one of the columns. 

 

Issue 1 : When the application loads - I would like it to be initialized with data which is already in the list including the filter which is in place.  I know it doesn't work like that because onSelect helps us to populate GalleryData, is there any alternative for this? 

 

Issue 2 : If on any other page there is some changes in share point list which feeds the data to gallery then those changes are not reflected automatically and I have to write something in textbox to make it work at times. This is more or less linked with previous issue itself, I am guessing if I sort out the initial load feature for gallery then this will be sorted as well. 

 

Thanks for your time. 

I have the same question (0)
  • Verified answer
    SeanHenderson Profile Picture
    1,104 on at

    Hi @Anonymous 

     

    Issue 1 -  Just put your OnSelect formula into the application's OnStart property:

    Annotation 2020-01-31 104942.png

     

    Issue 2 - You can put the refresh into your app navigation arrows and buttons to keep it up to date.

     

    ---
    Please hit the "Accept as Solution" button if my post answered your question! If my post was helpful please consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Just one change from what you have suggested, at place of using APP on start, I did the same on respective screen's onVisible and it seems to work alright. 

    Thanks a lot for your help.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 93 Most Valuable Professional

#2
Haque Profile Picture

Haque 81

#3
Valantis Profile Picture

Valantis 49

Last 30 days Overall leaderboard