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 / Upload collection of a...
Power Apps
Unanswered

Upload collection of audio files from an Android phone to SharePoint document library...

(0) ShareShare
ReportReport
Posted on by 5

How do you upload a collection of audio files from a mobile device (an Android phone) app to a SharePoint document library?

My PowerApp works okay on a mobile device to record more than one audio recording (from Microphone control) in my app on an Android (Google Pixel 2 XL with latest OS) that has been saved into a PowerApps collection. On a Windows 10 PC this works fine to send those files from a collection to a SP Document library as .mp3 files. But on my Android phone I can only send one file at a time from the Microphone1.audio control to SP. If I try to do the same from a collection I get errors. Is this a Microsoft bug?

Categories:
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @dalym ,

    Would you please share mode details about your implementation of your app? 

    How did you save the Audio to SharePoint library?

    What does 'only send one file at a time ' mean?

    What is the error message you met?

     

    More information is required to help us investigate your issue.

    Sik

  • dalym Profile Picture
    5 on at

    Hi Sik,

     

    Thanks for your help.

     

    1. I'm not sure what you mean by 'mode'. It's a canvas app that I've created on a Windows 10 laptop. To test it I use Power Apps on my Google Pixel 2 mobile phone which has the latest Android. Nearly all of my app works on the phone.
    2. This is the code I use for my Save.
      orAll(
      CollectPics,
      If(
      PhotoAudio = false,
      // Audio files.
      // UploadAudioToSP.Run(Microphone1.Audio,FileName);
      If(
      varMobileDesktop = "Mobile",
      // On a mobile device, such as an Android phone.
      Collect(
      CollectFileLinks,
      {
      FileLink: SubmitAudio.Run(
      JSON(
      {
      FileName: FileName,
      File: Microphone1.Audio
      },
      IncludeBinaryData
      ),
      Comment,
      AudioDuration
      ).sharepointfilelink,
      PrimKey: lvPrimKey,
      Comments: Comment,
      SHIC_Nbr: txtQ1.Text,
      Duration: AudioDuration,
      PhotoOrAudio: "Audio"
      }
      ),
      // On a Windows 10 desktop PC.
      Collect(
      CollectFileLinks,
      {
      FileLink: SHIC_UploadAudio.Run(
      FileName,
      AudioDuration,
      Audio,
      Comment
      ).sharepointfilelink,
      PrimKey: lvPrimKey,
      Comments: Comment,
      SHIC_Nbr: txtQ1.Text,
      Duration: AudioDuration,
      PhotoOrAudio: "Audio"
      }
      )
      ),
      // Photo files. Add data to a Collection: CollectFileLinks.
      Collect(
      CollectFileLinks,
      {
      FileLink: SHIC_PhotosToSP.Run(
      FileName,
      Photo,
      Comment,
      lvPrimKey
      ).sharepointfilelink1,
      PrimKey: lvPrimKey,
      Comments: Comment,
      SHIC_Nbr: txtQ1.Text,
      Duration: 0,
      PhotoOrAudio: "Photo"
      }
      )
      )
      );
    3. When the code goes down the 'Mobile' part of my code it will only copy an audio file using the Microphone control. So the actual audio recording must come only from 'Microphone1.Audio'.
      When the code goes down the 'Windows' part it takes the audio recording that has been saved to a collection.

      After I record an audio recording, this is how I save it to a collection:

      Collect(
      CollectPics,
      {
      GroupNbr: lblGroupNbr.Text,
      ItemNbr: lblItemNbr.Text,
      Photo: TakenPhoto,
      FileName: "Store_" & lblStoreNbr.Text & "SHIC_" & txtQ1.Text & "GrpID_" & lblGroupID.Text & "Item_" & lblItemNbr.Text & "Count_" & lblPicCount.Text + 1 & ".mp3",
      Comment: txtPhotoComment.Text,
      PhotoImage: Camera1.Photo,
      Audio: TempAudioB64,
      AudioDuration: Audio1.Duration,
      PhotoAudio: false
      }
      );

      // This Collect is for testing only.
      // Collect(
      // CollectAudio,
      // {
      // FileName: "Store_" & lblStoreNbr.Text & "SHIC_" & txtQ1.Text & "GrpID_" & lblGroupID.Text & "Item_" & lblItemNbr.Text & "Count_" & lblPicCount.Text + 1 & ".mp3",
      // File: Microphone1.Audio
      // }
      // );
      Reset(txtPhotoComment);
      Set(
      AudioSaved,
      true
      );
      Reset(Audio1)


      This collection saves all my media data - photos and audio recordings.

      I want to be able to record and save more than ONE audio recording file to a collection on my phone. Then the user can assess whether they want to keep all of them or delete any before they are committed to being copied to a SharePoint Document Library.
    4. The Power Apps error message is not up on my screen long enough to capture everything, but it had an error code: 502, BadGateway.
      The Power Automate flow error from my 'Create file' into SharePoint step had an
      Error: Action 'Create_file' failed
      Error Details: InvalidTemplate. Unable to process template language expressions in action 'Create_file' inputs at line '1' and column '12005': 'The template language function 'base64ToBinary' was invoked with a parameter that is not valid. The value cannot be decoded from base64 representation.'.

    From my limited understanding it has to do with the way Android (or iOS) mobile devices save audio file format as opposed to the way a Windows computer saves an audio file.

    There are lots of YouTube videos explaining how to save ONE audio file at a time and they are always from a Windows 10 laptop/desktop PC. I can save more than ONE audio file from a collection to a SharePoint document library, but I cannot make it work on my Android phone.

     

    I hope I've tried to give as much information as possible. Much appreciated for your help.

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @dalym ,

     

    I found you use two different flow to upload audio file to SharePoint separately -- SubmitAudio.Run() and SHIC_UploadAudio.Run() .

    What are the difference between both? Why do you need to divide this into two scenario(PC and Mobile)? 

    Please share the flow steps and running result of the flow for Mobile Device.

     

    Sik

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard