web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

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

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Verified answer
    v-bacao-msft Profile Picture
    on at
    Re: Conversion to json for attachments using "json()" not working so far

     

    Hi @Anonymous ,

     

    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 Power Platform Member Profile Picture
    on at
    Re: Conversion to json for attachments using "json()" not working so far

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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 655 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 371 Moderator

#3
chiaraalina Profile Picture

chiaraalina 276

Last 30 days Overall leaderboard