Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Create file manually provide file content

(1) ShareShare
ReportReport
Posted on by

I'm trying to create a flow that creates a file without calling/referencing a seperate file for 'file content'.

 

Have performed :

- Get file content (Onedrive/Excel)

- Create file (Onedrive) and configuring file content to the 'file content' from 1st step using dynamic data

 

No issue with above.  However, if I just try and copy/paste the output of the 1st step (Get file content) and paste it into 'file contents' field in the 2nd step, the result is a corrupt file.

 

Have also tried creating a variable, setting the value by copy/pasting output from 1st step.  Copy/paste the output itself, not using dynamic data to point to output of 1st step.  Used this variable as 'file content' in 2nd step, failed.  

 

Created compose statement with value of the 1st step, same failure.  Tried assigning value of the variable above to compose statement, failed as well.

 

Cross checked the raw input of all attempts against raw input where 'file content' is referenced directly using dynamic data, and there are always differences.

 

Can what I am describing be done?  What would be proper way to get the file content from source, and use it to create a new flow/file independent of source?

Categories:
  • WillPage Profile Picture
    WillPage 1,877 on at
    Re: Create file manually provide file content

    the file content input of a Create file action expects base64 encoded file content in a JSON object like this:

    {
     "$content-type": "application/pdf",
     "$content": "/9j/4QEeRXhpZgAATU0AKgAAAAgABwEAAAQAAAABAAAGYwEQAAIA..."
    }

    Substitute the content type and base64 bytes with your own file mime type and content. You can use probably application/octet-stream as a catch-all MIME type.

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,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard