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 / Gallery items reset
Power Apps
Answered

Gallery items reset

(0) ShareShare
ReportReport
Posted on by 13

Hey everyone,

 

I have a 2 screen app. On 1st screen, user enters data and hits a Submit button, data is stored in a variable and user is navigated to 2nd screen. On 2nd screen, there's a gallery with data source pointing to a REST Api with the query containing the variable from the 1st screen. It takes ~10 seconds to load data from API and items are populated. There's also a "Go back" button on second screen.

 

When the application runs for the first time, everything is working fine. If the user hits the back button on 2nd screen , enters new data on first screen and hits Submit again, app navigates to 2nd screen and calls the Api with the new value as expected.But the problem is, while the application is waiting for the results from Api, it shows the results from the previous query.

 

Is there a way to reset the Gallery Items to blank before submitting the query to Api or when user hits "Go back" button ? Or hide the Gallery until results are retrieved maybe?

 

Thank you.

Categories:
  • Verified answer
    Whis Profile Picture
    13 on at

    I set 2nd screen's OnVisible to 

     

    UpdateContext({QueryResults:Blank()}); UpdateContext({QueryResults:MyAPI.MyFunction(MyVariable)})

     

    and Items of gallery to QueryResults instead of the API calling function . This fixed the issue. Leaving the question here if anyone else needs this information.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard