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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to convert base64 ...
Power Automate
Answered

How to convert base64 file into docx/pdf file?

(3) ShareShare
ReportReport
Posted on by 11

Working with a third party REST API, after making a request to the API, it returns the document content in base64 format. How do I convert it to a docx/pdf format using Power Automate?

Categories:
I have the same question (0)
  • Verified answer
    Mira Ghaly Profile Picture
    11,413 Moderator on at

    @pepega 

     

    You can create a file in sharepoint or one drive.

     

    You have to pass in the below format

    {
    "$content-type": "application/pdf",
    "$content": base64returnedfromAPI
    }
    Mira_Ghaly_0-1620194258645.png

     

     

  • ShanKM Profile Picture
    45 on at

    Try this out 

    https://lazybots.blogspot.com/2021/06/convert-to-pdf-using-api-power-automate.html

     

    this explains how to create file from base64 string, and also how to convert a file to base64 string

  • Jeffrey O Profile Picture
    11 on at

    Best answer I have found in days of looking through many articles. Thank you much for this.

  • amalguri Profile Picture
    2 on at

    @Mira_Ghaly Can you please tell me how can we convert a pdf file to base64 in powerapps ?

  • Jeffrey O Profile Picture
    11 on at

    Use Power Automate and apply the selected answer above.

  • BrettyMandrin Profile Picture
    18 on at

    Open free Base64 website and choose Convert application.
    Click inside the file drop area to upload Base64 files or drag & drop Base64 files.
    You can upload maximum 10 files for the operation.
    Click on Convert button. 
    Download link of result files will be available instantly after conversion.

     

    Regards,
    Bretty

  • RichardVR Profile Picture
    19 on at

    Could you tell me how convert base64 into mp3? Thank you in advanced for your time ✌️

     

  • Gotorus Profile Picture
    18 on at

    I had the same problem and realised your solution. But it don't works for me. Could you have an idea what the problem is? See the seperate thread here: Convert Base64 from a RestAPI JSON into a PDF - Power Platform Community (microsoft.com)

  • arodriguez107 Profile Picture
    31 on at

    Likewise.  I'm running an HTTP GET request which returns file attachment content encoded in base64 format.  This returns and object similar to the OP's post above:

     

    {
     "content-type": "application/pdf", 
     "$content": "Base64String"
    }
    

     

    When I use this object to create a file in OneDrive, the pdf is created, but seems corrupted.  I get an error message stating: "Error:Failed to load PDF document.

  • originalltd Profile Picture
    85 on at

    This solution works for SharePoint / OneDrive, but not for "File System - Create File". We get "Forbidden" 403 when trying to create the file. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 507 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 267 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard