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?
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.