I am having a hard time with this. What I am trying to do, is to build a self help app to show videos that are attached to a SharePoint list. I am able to get the first screen to show the item, thumbnail, and when you tap, takes you to the list item with the description and summary for each.
It shows the thumbnail and I can add a media/Video control, which is nested under the gallery. I then add First(ThisItem.Attachment).AbsoluteUri and can see the video.
The problem is that it shows the same video for all list items. How can this be changed to only show the attachment for that list item? Any help would be greatly appreciated!
Just a follow up question. Now the videos show per List item, which is exactly what I needed. Now when I play the App, the Video dissapears. I can hear it if I set it to autoplay, but dissapears. Anything I have to change?
Nevermind, I figuered it out. Now, the only issue is with videos not playing on the mobile version. I can't catch a break.
That worked! Thank you so much!!
Understood and thank you for clarifying. Trying this now and will report back!
Back to my original comment. Instead of using ThisItem. which is used inside a gallery to reference the item in that row of the gallery, you should use first(BrowseGallery1.selected.attachments) since I think they are picking the list item they want from the BrowseGallery.
Each SharePoint List item has it's own attachment. I used the standard SharePoint template in Power Apps to see the list items.
Ideally, after clicking on the first video in the main screen:
And then going to the first item:
I would want the attachment to show like above, but I keep getting the same video for List item 1, in List item 2.
Is there a way to show each attachment in each list item? Whenver I make a change to one, it duplicates the same on the second one. Sorry, I am new to Power Apps.
Forgot to mention, each List item has only one attachment.
I'm assuming the card/form is pulling things based on the Selection in the BrowseGallery. I was suggesting you get the video based on that selection. But are you saying that each item that can be selected has multiple attachments and all are videos? Or is there one video attached to each list item? First() and Last() can only get attachments out of the attachments collection based on their placement. So if each item has more than one attachment you'll need to filter the attachments array based on file extension to get just the .MP4 files. If there is only one .mp4 in each set of attachments then you can use First() around that filter to get the file to play.
This is how I have it set:
If I were to use your method, would it replace where the script goes above, or does it not go nested under the gallery?
Yes, my apologies for not including a screenshot. The first one shows the list item 1 with the correct video (12 mins), the second one shows list item 2 and the same video (12 mins). Should be 4 min video.
I added a video elemento the gallery for the second screen and added the ListAttachments script.
I’m not picky how the video plays or if embedded in a button. I just want it to play the video attachment for the list item since they are specific for each. Also, I do not have the Microsoft Stream option since it is a government account.
I think what you want is to use some form of Galleryname.Selected instead of ThisItem. But it depend on what you are using to show the thumbnail etc. A screenshot with some more information would help.
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
mmbr1606
275
Super User 2025 Season 1