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 / Collections is not emp...
Power Apps
Answered

Collections is not empty, when it should be...sometimes

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have an application that collects photos into a collection. However, sometimes the gallery of photos is pre-populated with empty pictures. This isn't always the case, but it has happened enough where it seems to be a bug of some sort. The functionality of my app is to choose some kind of a location ID, then go into a form that has you take photos and uploads them. However, if I'm someone who first enters this location ID, I shouldn't be seeing photos already. I have a delete functionality, so it just has a trashcan next to all these blank photos. I've tried to "Clear" my collection every time I select a new location, but this bug keeps occuring even after that change. Any ideas?

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    @Anonymous 

     

    You can clear clear the collection either on Page "OnVisible" or App "OnStart" to clear out all the photos. If you have any control that will affect this collection, you can modify the OnChange property.
     
    One thing, though these blank image with trashcans appears when there is no picture captured on camera but it is collected in the collection. Can you please confirm all the formula that are collecting this collection is getting triggered when not required? If so, we may need to redefine the formula for it. Please share a bit more information about how you are trying to collect this collection, maybe through some snippet/screenshot?
     
    Hope  this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    How do you collect the images into a Collection within your app? Using Camera control to capture pictures?

    Could you please share more details about the formula you used to capture the images captured via Camera control?

     

    Based on the needs that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The App's configuration as below:3.JPG

     

    4.JPG

    Set the OnSelect property of the Camera control to following:

    Collect(CapturedImages, Camera1.Photo)

    Set the Items property of the Gallery to following:

    CapturedImages

     

    In addition, I also made a test on my side, if you type above Collect formula within the OnSelect property of another Button control rather than within the OnSelect property of the Camera control itself, the CapturedImages collection would contains empty record.

    So please do not type your Collect formula within the OnSelect property of another button control, instead, you should type it within the OnSelect property of the Camera control itself.

     

    Please consider take a try with above solution, then check if the issue is solved.

     

    Best regards,

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
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard