cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jharville
Helper V
Helper V

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

 

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?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

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.

 

View solution in original post

8 REPLIES 8
WarrenBelz
Super User
Super User

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?

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

 

 

 

 

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
Helper V
Helper V

@WarrenBelz 

 

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

@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?

 

 

 

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.

@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?

@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.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,656)