cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Madiko
Frequent Visitor

Cannot upload attachments using JSON PARSE

Hello everyone,

Can you please help me with this issue. I have an issue with parsing my file content in my flow for create a new file (SharePoint Document Library). I have PowerApp for to upload attachments using attachment control. I'm using it by JSON PARSE, actually it makes copy of a file and upload it to SharePoint. However, when I open my file in SharePoint it's corrupted and size is 1kb.

 

See my screenshots:

this error message what I have when I open a file in SharePoint

Madiko_0-1633053325155.png

 

 

 

This is how my flow looks:

Madiko_0-1633053493989.png

 

 

Madiko_1-1633053512285.png

 

 

Madiko_2-1633053523461.png

 

 

 

dataUriToBinary(items('Apply_to_each')['DataStream'])

 

I built this flow using this guide video: https://www.youtube.com/watch?v=5XsWgVnR7SU

 

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
ekarim2020
Super User
Super User

 

What output are you getting from the expression?

dataUriToBinary(items('Apply_to_each')['DataStream'])

You can use a compose action for this:

ekarim2020_1-1633199302925.png

After you re-run the flow, we expect to see something similar to the following as the output of the compose action. The output should show two properties $content-type and $content, example:

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

 Ellis

View solution in original post

1 REPLY 1
ekarim2020
Super User
Super User

 

What output are you getting from the expression?

dataUriToBinary(items('Apply_to_each')['DataStream'])

You can use a compose action for this:

ekarim2020_1-1633199302925.png

After you re-run the flow, we expect to see something similar to the following as the output of the compose action. The output should show two properties $content-type and $content, example:

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

 Ellis

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (3,784)