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 / How to "refresh" a gal...
Power Apps
Unanswered

How to "refresh" a gallery? Or trigger gallery to refresh from another control?

(0) ShareShare
ReportReport
Posted on by

I have two galleries. The first one displays a day with all entries of work for that day (glry_Day). The second displays the week with a sum of hours of entries for the days of that week (glry_Week). The galleries are populating correctly with data, from an Excel spreadsheet.

 

When I click an arrow control on glry_Week, say for 05/06/24, I want to make glry_Day visible and populate it with the data that corresponds with that day. To do that, I have set the following:

 

// I use a variable for visibility and the date value, both are being set correctly

glryDayArrow.OnSelect >

 

Set(varScrn2Focus, "Day");
Set(varDateValue, DateAdd(ThisItem.Date, TimeZoneOffset(), TimeUnit.Minutes));

 

 

glry_Day.Items >

 

Sort(Filter(facTimeEntry, EmployeeName = User().FullName && DateAdd(TimeEntryDate, TimeZoneOffset(), TimeUnit.Minutes) = varDateValue), TimeIn, SortOrder.Ascending)

 

 

 

This successfully changes to the glry_Day but does not display the entries:

 

pa1.png

 

If I click the date picker (without choosing a date), or if I do choose a date, the entries appear as normal:

 

pa2.png

 

The date picker control simply sets varDateValue to its selected date:

 

dtpk_DayPicker.OnSelect (and OnChange)

 

Set(varDateValue, Self.SelectedDate);

 

 

The default date is also set using the variable:

 

dtpk_DayPicker.Default

 

varDateValue

 

 

 

How do I trigger the gallery to "refresh" as if the date was picked from the date picker, when clicked from the other gallery's arrow control?

Categories:
  • VishalJhaveri Profile Picture
    1,169 Moderator on at

    Basically, you need to refresh the datasource because ultimately that is the part which is mentioned in the gallery.

    You need to store it somewhere in collections or any other datasource and pass it back.

  • CU30070808-0 Profile Picture
    on at

    You would need to apply the refresh function to the onSelect property of the arrow control. 

     

    https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-refresh

     

     

  • dhess003 Profile Picture
    6 on at

    Refresh function in the onSelect property of the arrow control does not work.  Besides, the data hasn't changed.

     

    Placing Select(dtpk_DayPicker) in the onSelect code of the arrow was the fix.

     

     

  • dhess003 Profile Picture
    6 on at

    The "fix" for this was to run the following from the arrow control:

     

    Select(dtpk_DayPicker)

     

    This triggered the OnSelect event of the date picker control, which was working correctly.

     

     

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard