web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Cannot Get Video Attac...
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!

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,417 Most Valuable Professional on at

    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.

     

  • CountDooku_415 Profile Picture
    43 on at

    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

  • CountDooku_415 Profile Picture
    43 on at

    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?

  • Pstork1 Profile Picture
    69,417 Most Valuable Professional on at

    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

    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.

  • Verified answer
    Pstork1 Profile Picture
    69,417 Most Valuable Professional on at

    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

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

  • Verified answer
    CountDooku_415 Profile Picture
    43 on at

    That worked! Thank you so much!! 

  • CountDooku_415 Profile Picture
    43 on at

    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.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,045

#2
Valantis Profile Picture

Valantis 675

#3
11manish Profile Picture

11manish 592

Last 30 days Overall leaderboard