Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Save Base64 file to sharepoint

(0) ShareShare
ReportReport
Posted on by 32
Is there a way to backup activitymimeattachment to sharepoint? Activity images like email attachements are stored in activitymimeattachment as base64 but I would like to convert each file from its base64 and save it to sharepoint. I've tried base64ToBinary() function in Power automate but it did not work. So if any of you can help or have some ideas.
  • Verified answer
    SaiRT14 Profile Picture
    1,988 Super User 2025 Season 1 on at
    Save Base64 file to sharepoint
    i fixed with the following steps:

    1. Trigger the Flow: Use a trigger such as "When a record is created/updated in Dataverse" to detect new or modified attachments in the activitymimeattachment tables Alternatively, use a manual trigger to process existing attachments.
     
    2. Retrieve the Attachments: Use the Dataverse "Get a row by ID" action to fetch the attachment record from the activitymimeattachment table. Ensure the following fields are included: filename (name of the attachment) body (base64 content) mimetype (MIME type of the attachment, e.g., application/pdf, image/jpeg).
     
    3. Decode the Base64 Content: Add a Compose action in Power Automate. Use the following expression to decode the base64 content: base64ToBinary(triggerOutputs()?['body/body']) - Replace triggerOutputs()?['body/body'] with the correct reference to the body field containing the base64 data.
     
    4. Create the File in SharePoint: - Use the "Create file" action in the SharePoint connector - Specify the folder path where the file should be saved. Set the File Name to the value of filename. Set the File Content to the output of the Compose action (decoded binary).

     

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