Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Photo (Attachment) Won't Update In View Screen Until Second Time Selected

(0) ShareShare
ReportReport
Posted on by

 

Hello all,

 

I have an application that is linked to a back-end SharePoint list. Inside that SharePoint list, we have rooms that have a corresponding photo to each room. 

 

When I access the detail screen of a specific room, it shows the correct photo (attachment) to that corresponding room:

 

jharville_0-1632856028870.png

 

However, when I go back to my main Room selection gallery...

 

jharville_2-1632856415060.png

 

...and select a different room, instead of showing the correct photo (attachment) for that new room, it displays the previous photo (attachment) of the last room that was clicked on:

 

jharville_0-1632856203594.png

 

The weird part is that when I navigate back to the Room selection gallery and select that same second room I previously selected again, it shows the correct photo (attachment):

 

jharville_1-1632856345848.png

 

----------------------------------------------------------------------------------------

 

The 'Items' property of my Gallery (to show the room photo) is the following photo (colAttachmentCon is just a collection that holds the photos to each corresponding room from SharePoint)

 

jharville_3-1632856556761.png

 

It's weird how the correct corresponding room shows the 2nd time the new room is clicked on, but not on the 1st time (and instead shows the previous room photo selected). Would anybody know what the issue may be?

 

 

  • WarrenBelz Profile Picture
    146,670 Most Valuable Professional on at
    Re: Photo (Attachment) Won't Update In View Screen Until Second Time Selected

    @jharville ,

    I must admit I always start with a blank canvas, so any  code in there is mine (and I can't blame anyone else when it does not work). There may be something in there (try Screen OnVisible and App OnStart) unexpected.

     

    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.

  • jharville Profile Picture
    on at
    Re: Photo (Attachment) Won't Update In View Screen Until Second Time Selected

    @WarrenBelz 

     

    We used a pre-existing template on PowerApps as a base for our app, and then built onto it. Do you think that may be the root cause of the refreshing issue?

  • WarrenBelz Profile Picture
    146,670 Most Valuable Professional on at
    Re: Photo (Attachment) Won't Update In View Screen Until Second Time Selected

    Hi @jharville ,

    Is this a canvas or integrated app? There are sometimes refreshing issues with integrated when a new item is selected without refreshing the list.

  • jharville Profile Picture
    on at
    Re: Photo (Attachment) Won't Update In View Screen Until Second Time Selected

    @WarrenBelz 

     

    Hi Warren, I've had my team do extensive testing of the functionality and there's one little thing that is still off. When you play the application, the very first time you select an item from the Detail screen, it doesn't properly show the photo:

     

    jharville_1-1632923756860.png

     

    But when I go back to the Room selection gallery and re-select the same item, it shows properly:

     

    jharville_0-1632926694667.png

     

     

    Your solution (using 'conAttachmentBox.Attachments' in the Items property of the Gallery) helped get rid of the issue that always showed the previously-selected Room photo in the current selection.

     

    The issue we have now only occurs in the first instance of when a room is selected in the Detail screen. Once the user experiences that issue during the first instance, and navigates to other Items in the Detail screen ... there are no more problems/issues at all. This glitch only occurs in the first instance of selecting a room (when you open the app by selecting "Play", navigate to the Detail screen, and select a room for the first time). Would you know what may be the issue?

     

     

     

  • jharville Profile Picture
    on at
    Re: Photo (Attachment) Won't Update In View Screen Until Second Time Selected

    @WarrenBelz 

     

    Referring to the hidden Attachment control did the absolute trick. Thank you so much Warren!! 🙂

  • Verified answer
    WarrenBelz Profile Picture
    146,670 Most Valuable Professional on at
    Re: Photo (Attachment) Won't Update In View Screen Until Second Time Selected

    Hi @jharville ,

    I suspected the collection, but it should refresh (it obviously is not). However you really do not need it. You can simply refer to the attachment control for the gallery Items (I assume you have it hidden on the form).

    conAttachmentBox.Attachments

     Another way (which I use) is to put the gallery in a Custom Card and the Items are simply

    ThisItem.Attachments

    or if outside the form

    LookUp(
     ListName,
     ID=GalleryName.Selected.ID
    ).Attachments

     

    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.

     

  • jharville Profile Picture
    on at
    Re: Photo (Attachment) Won't Update In View Screen Until Second Time Selected

    @WarrenBelz 

     

    The collection, colAttachmentCon , is created in the OnVisible of the Details screen:

     

    jharville_0-1632860755725.png

     

    The 'Items' of the Photo Gallery is:

     

    jharville_1-1632860800560.png

     

    And the 'Items' of the image control is:

     

    jharville_2-1632860884408.png

     

    Lastly, the label of the Image is:

     

    jharville_3-1632861005030.png

     

     

    Thank you!

     

     

     

     

  • WarrenBelz Profile Picture
    146,670 Most Valuable Professional on at
    Re: Photo (Attachment) Won't Update In View Screen Until Second Time Selected

    Hi @jharville ,

    What are the Items of the photo Gallery and the Image property of the Image control. I see you have a collection referenced - wen /how to you collect it and what is in it?

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,011 Most Valuable Professional

Leaderboard