cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

Conversion to json for attachments using "json()" not working so far

Hi Team,

 

So currently i have a scenario in which i'm pulling the incoming attachment and their contents and trying to send them over an email 

 

So in the attachments section of send an email v2 i'm passing the json as below :

 

[

 { "Name" : "{attachment name}",

   "ContentBytes" : "{base64 encoded bytes for content returned by the API}"

 }

]

 

There are following steps for my flow :

 

Step 1 : Send the http request for different urls for different attachments and receive the their data (content-type and contentbytes)

Step 2 : Creating an Array as per the format required to send over the email that means (can be understood in below image )

Step 3 : Converting the array to the string

Step 4 : Converting the string to json

Step 5 : Sending it over in the email step

 

The problem is I'm not getting any attachments at all in the output email.

 

Flow image 1Flow image 1Flow image 2Flow image 2Flow image 3Flow image 3Output 1Output 1output 2output 2Output of emailOutput of email 

 

I think the data is not perfectly getting converted into the json? Can someone help me i really need to get it over with

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

 

Hi @SaifAli ,

 

You need to add double quotes outside of Name and ContentBytes, please refer to this blog and see if it helps:

https://flow.microsoft.com/en-us/blog/multiple-attachments-single-email/

And it seems that you don't need to use the json() function to convert it. You can directly fill the array variable output from the Append to array variable 2 action in Attachments field, just like the configuration in the Blog.

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support
Community Support

 

Hi @SaifAli ,

 

You need to add double quotes outside of Name and ContentBytes, please refer to this blog and see if it helps:

https://flow.microsoft.com/en-us/blog/multiple-attachments-single-email/

And it seems that you don't need to use the json() function to convert it. You can directly fill the array variable output from the Append to array variable 2 action in Attachments field, just like the configuration in the Blog.

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

@v-bacao-msft  Thanks a lot! it was really helpful along with the blog.

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (8,217)