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 / Playing Audio file fro...
Power Apps
Answered

Playing Audio file from Sharepoint site

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi 

I have a canvas application that read lists from my sharepoint site https://mycompany.sharepoint.com/sites/Communication, it is working fine.

I have a flow that save speech files in this Sharepoint site under a folder "audiofiles"

Now I want to use powerapps media to play the audio file from the url https://mycompany.sharepoint.com/sites/Communication/audiofiles/fileName.wav

The audio media doesn't play the file in mobile but it play it well when I open the canvas app in the computer browser.

The app media can play public audio nicely in mobile & PC such as https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3 but will not play the same file if I saved it in the sharepoint site under /audiofile/.

 

I also added the sharepoint folder which host the audio file in my app and I can display it's content (audio files) in a browser gallery.

I also tried using html5 inisde HTML Text control using <audio src"" controls></audio> again same problem, not working in mobile powerapps.

 

How come I can call the lists from the site but I can't play the audio file.

 

Is it something related to CORS in Sharepoint, if yes, how to solve it?

If I can call the document library folder in my app, can I call the audio files from it and pass it to media player?

 

My Goal: I am looking for a way to let media player to play my audio files hosted in the Sharepoint site.

 

Regards,

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,127 Most Valuable Professional on at

    Hi @Anonymous ,

    This is a solution is that you will stop trying - see this post.

    It is exactly the same reason that photos in a SharePoint Library will not display on a mobile device (although there is a workaround for these with Thumbnails).

    I have tried with OneDrive, Google Drive and Dropbox also without success, although on this post, it was suggested Dropbox might work, it worked form me on the PC by not mobile.

    Bear in mind however if you want to add these to the Media in PowerApps (size limits apply), they will work.

     

    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.

     

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    After long hours trying many workarounds, I was able to find an easy way to play the audio files directly from SharePoint. It was inspired by BrwoserGallery1.selected.Attachments in the post link shared by @WarrenBelz. This saved me adding more components like the gallery.

    I put a text label to display the attachment value result coming from the

     

    First(BrwoserGallery1.selected.Attachments).Value

     

     I got a link in this format 

     

    appres://datasources/myList/table/7e5xxx-xxxx-xxx-xxxx-xxxx/rows/2/reference/https:%2F%2Fxxx-00x.azure-apim.net%2Fapim%2Fsharepointonline%2F3c....Attachments%2525252f2%2525252f{myfilename}.wav%2F$value

     

     

    When I passed this link as media the audio player plays my audio file from SharePoint without any problems. Now I deleted the BrowseGallery and the text label from my canvas app and start passing the filename through the list columns.

     

    This might not be a proper solution but considering the current stage of PowerApps components its enough for me.

     

    Hope this helps someone in the future.

     

    Thanks goes to @WarrenBelz 

     

    Regards,

     

    Ashraf Awwad

  • WarrenBelz Profile Picture
    156,127 Most Valuable Professional on at

    Thats great @Anonymous ,

    Rather ironic I did not take my own advice . . .

    I was focusing on your requirement to play from a Library. It is however interesting that the same workaround for photos to show images that work on both PC and mobile devices also plays audio - this actually makes a lot of sense, but like most "left field" solutions, they are not obvious.

  • WarrenBelz Profile Picture
    156,127 Most Valuable Professional on at

    Hi @Anonymous ,

    I don't think you realize what you may have discovered here - I cannot find anything on it in a Google search.

    You can turn Power Apps into a Media Player with a Gallery of tunes and even filter them by genre, artist, album etc, but better than that, instructional audio files and even audio help on errors can be done.

    All that is needed is to attached one media file to each list item and then set the Media (as you have discovered) to 

    First(GalleryName.Selected.Attachments).Value

    then select the item and press Play on the media player. The two things I have not been able to work out is how to autoplay more than the first item and how to get the value with a Lookup.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz 

     

    With this URL I was able to call any media file directly from the document library, now I can play the audio if I know the filename so I am passing it along with the Title in one list.

    By querying the list using the ID, I can get the filename and pass it to the media player as media property

     

     

    "appres://datasources/myList/table/7e5xxx-xxxx-xxx-xxxx-xxxx/rows/2/reference/https:%2F%2Fxxx-00x.azure-apim.net%2Fapim%2Fsharepointonline%2F3c....Attachments%2525252f2%2525252f" & LookUp(selectedAudio , ID=<query ID>).filename & "%2F$value"

     

     

    In my case am passing the audio selection between screens using created lists from the original list:

    AudioList (initial loading from SharePoint) -> colAudio (PowerApps on Start) -> selectedAudio (when one item related to audio selected)

    this way I am using only First 

     

     

    "appres://datasources/myList/table/7e5xxx-xxxx-xxx-xxxx-xxxx/rows/" & First(selectedAudio).ID & "/reference/https:%2F%2Fxxx-00x.azure-apim.net%2Fapim%2Fsharepointonline%2F3c....Attachments%2525252f2%2525252f" & First(selectedAudio).filename & "%2F$value"

     

     

     

    Regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, WarrenBelz.

     

    Were you able to find a solution to the Lookup formula for this? because I have the same issue where I am trying to access the file via hyperlink in SharePoint. I don't really want to put an unnecessary gallery just to get this to work.

  • WarrenBelz Profile Picture
    156,127 Most Valuable Professional on at

    @Anonymous ,

    This is a rather old thread and I am not sure what exactly the Lookup you are referring to is. You might defer to @aawood here as I have not bothered with this one since as I have no use for it currently.

  • Vadiraj_d Profile Picture
    2 on at

    @Anonymous Can u please share the steps 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard