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:
However, when I go back to my main Room selection gallery...
...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:
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):
----------------------------------------------------------------------------------------
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)
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?
Solved! Go to Solution.
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.
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?
The collection, colAttachmentCon , is created in the OnVisible of the Details screen:
The 'Items' of the Photo Gallery is:
And the 'Items' of the image control is:
Lastly, the label of the Image is:
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.
Referring to the hidden Attachment control did the absolute trick. Thank you so much Warren!! 🙂
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:
But when I go back to the Room selection gallery and re-select the same item, it shows properly:
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.
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?
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.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
195 | |
45 | |
45 | |
44 | |
37 |
User | Count |
---|---|
279 | |
81 | |
81 | |
80 | |
69 |