cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dalym
Regular Visitor

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

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?

3 REPLIES 3
v-siky-msft
Community Support
Community Support

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

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
Community Support
Community Support

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

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (18,635)