web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery wont load item...
Power Apps
Answered

Gallery wont load items when form is opened

(0) ShareShare
ReportReport
Posted on by 123

I have a custom form on a list that should load gallery items from another list when the form is opened. 

 

The items from the supporting list are gathered with a ClearCollect() statement in the OnEdit and OnView properties as I do not need to gather any items when the form is new. 

 

The clear collect doesnt seem to run even when there are items available to be gathered. 

 

I have put in a refresh button with the exact same code as the OnEdit and OnView, and this pulls in the items correctly. 

 

If I open the form, close it, and reopen it the items are pulled in correctly. 

 

I have tried placing the clearcollect statement in onvisible and onstart, and even to run when a timer starts but the same thing happens. Nothing is pulled in at the start and the form has to be closed and re-opened without refreshing the browser, or you have to click the refresh button.

 

This feels like such a simple thing but it is driving me crazy, so turning to you guys for some ideas.  I can provide screenshots if needed!

 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,059 Most Valuable Professional on at

    Hi @CamCov ,

    One of the issues with Integrated Forms is that they do not run (among other things) App OnStart or Screen OnVisible when another record is selected unless the user refreshes SharePoint in the browser between records. The only "variable" that changes is the record reference SharePointIntegration.SelectedListItemID as this facility was designed to be a simple edit/new/view form reflecting the current chosen record and actually "stays open" - the "close" command is RequestHide(), for performance reasons to display the next record.

    You might consider a Canvas app for this one as you will face more challenges the more complex you make this.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • CamCov Profile Picture
    123 on at

    Thanks Warren. 

     

    I was able to get it to work by using the SharePointIntegration.SelectedListItemID instead of SharePointIntegration.Selected.ID and clearcollecting inside the onview and onedit. Not sure what the difference is, but happy its working. Thanks for the 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard