Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Cannot Get Video Attachment Per List Item

(0) ShareShare
ReportReport
Posted on by 43

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!

  • CountDooku_415 Profile Picture
    43 on at
    Re: Cannot Get Video Attachment Per List Item

    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.

  • Verified answer
    CountDooku_415 Profile Picture
    43 on at
    Re: Cannot Get Video Attachment Per List Item

    That worked! Thank you so much!! 

  • CountDooku_415 Profile Picture
    43 on at
    Re: Cannot Get Video Attachment Per List Item

    Understood and thank you for clarifying. Trying this now and will report back!

  • Verified answer
    Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Cannot Get Video Attachment Per List Item

    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.

  • CountDooku_415 Profile Picture
    43 on at
    Re: Cannot Get Video Attachment Per List Item

    Screen Shot 2023-10-22 at 10.52.25 AM.png

    Screen Shot 2023-10-22 at 10.53.19 AM.png

    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:

    Screen Shot 2023-10-22 at 10.55.11 AM.png

    And then going to the first item:

    Screen Shot 2023-10-22 at 10.55.19 AM.png

    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.

  • Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Cannot Get Video Attachment Per List Item

    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.

  • CountDooku_415 Profile Picture
    43 on at
    Re: Cannot Get Video Attachment Per List Item

    This is how I have it set:

    Screen Shot 2023-10-22 at 10.34.55 AM.png

    If I were to use your method, would it replace where the script goes above, or does it not go nested under the gallery?

  • CountDooku_415 Profile Picture
    43 on at
    Re: Cannot Get Video Attachment Per List Item

    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.

    Screen Shot 2023-10-22 at 10.19.38 AM.png

    Screen Shot 2023-10-22 at 10.19.51 AM.png

  • Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Cannot Get Video Attachment Per List Item

    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.

     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1