Skip to main content

Notifications

Power Automate - General Discussion
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?

  • SB-22082215-0 Profile Picture
    SB-22082215-0 2 on at
    How to convert base64 file into docx/pdf file?
    I have tried these steps. But it's not working. Everytime I have the error in the Action 'Create_file' failed -> The provided workflow action input is not valid.
     
    Could you share your whole flow?
  • cs0nro Profile Picture
    cs0nro 4 on at
    Re: How to convert base64 file into docx/pdf file?

    Just the raw Base64 not the Base64ToString. Fantastic!

  • originalltd Profile Picture
    originalltd 85 on at
    Re: How to convert base64 file into docx/pdf file?

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

  • arodriguez107 Profile Picture
    arodriguez107 31 on at
    Re: How to convert base64 file into docx/pdf file?

    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.

  • Gotorus Profile Picture
    Gotorus 18 on at
    Re: How to convert base64 file into docx/pdf file?

    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)

  • RichardVR Profile Picture
    RichardVR 19 on at
    Re: How to convert base64 file into docx/pdf file?

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

     

  • BrettyMandrin Profile Picture
    BrettyMandrin 18 on at
    Re: How to convert base64 file into docx/pdf file?

    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

  • Jeffrey O Profile Picture
    Jeffrey O 11 on at
    Re: How to convert base64 file into docx/pdf file?

    Use Power Automate and apply the selected answer above.

  • amalguri Profile Picture
    amalguri 2 on at
    Re: How to convert base64 file into docx/pdf file?

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

  • Jeffrey O Profile Picture
    Jeffrey O 11 on at
    Re: How to convert base64 file into docx/pdf file?

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

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,304

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard