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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / JSON formatting issues
Power Automate
Answered

JSON formatting issues

(0) ShareShare
ReportReport
Posted on by 604

This got marked as spam last time I tried to post, not sure why...

 

Mailchimp allows batch operations, allowing you to complete multiple operations with a single call.  Helpful when dealing with hundreds/thousands of records.  The format of the JSON is causing me a headache though.  This is what it needs to look like (confirmed working in postman)-

 

{
	"operations": 
	[
	{
	"method":"POST",
	"path": "/lists/f8b596c66e/members/",
	"body":"{
 \"email_address\": \"test1@gmail.com\",
 \"status\": \"subscribed\", 
 \"merge_fields\": {
 \"FNAME\": \"Test\",
 \"LNAME\": \"One\",
 \"ADDRESS\": {
 \"addr1\": \"1122 Rad Dr\",
 \"addr2\": \"\",
 \"city\": \"Toledo\",
 \"state\": \"OH\",
 \"zip\": \"12345\",
 \"country\": \"US\"
 },
 \"PHONE\": \"1233047645\",
 \"COMMERCIAL\": 1,
 \"SALUTE\": \"Dear Dan\",
 \"SOURCE\": \"CR\",
 \"ACQUIRED\": \"2019-01-01\",
 \"ARBAL\": \"\",
 \"RAU\": \"\",
 \"EXPIRES\": \"2019-07-01\",
 \"SECONDARYP\": \"1236996491\",
 \"CUSTID\": \"12345\",
 \"LOCATION\": \"1\"
 }
		}	
	"},
	{
	"method":"POST",
	"path": "/lists/f8b596c66e/members/",
	"body":"{
 \"email_address\": \"dan@tech.com\",
 \"status\": \"subscribed\",
 \"merge_fields\": {
 \"FNAME\": \"Dan\",
 \"LNAME\": \"I\",
 \"ADDRESS\": {
 \"addr1\": \"12 Road\",
 \"addr2\": \"\",
 \"city\": \"Toledo\",
 \"state\": \"OH\",
 \"zip\": \"12345\",
 \"country\": \"US\"
 },
 \"PHONE\": \"1233047645\",
 \"COMMERCIAL\": 1,
 \"SALUTE\": \"Dear Dan\",
 \"SOURCE\": \"CR\",
 \"ACQUIRED\": \"2019-01-01\",
 \"ARBAL\": \"\",
 \"RAU\": \"\",
 \"EXPIRES\": \"2019-07-01\",
 \"SECONDARYP\": \"1236996491\",
 \"CUSTID\": \"12345\",
 \"LOCATION\": \"1\"
 }
		}
	"}
	]
}

Looks fun, right?  

 

My problem is that it's adding quotes around part of the JSON I've generated

aia-error3.png

 

 

 

 

 

Relevant part of the flow (if it's not large enough- https://i.imgur.com/tuenGFS.png )-

The Input for Generate Record is a solid block to avoid it adding \n \t in later compose operations.

It also will not accept it as valid JSON without the whole thing inside single quotes, hence the compose action to remove those.  

 

aia-flow.png

 

The ouput from Compose 3 is what I need, I just need to stick this inside the main operations object without it adding the double quotes

 

aia-good.png

 

 

No matter how I try to do that, it will add double quotes around the entire object array (not each array item), as shown above.  Converting it to JSON works, but that strips all the escaped double-quotes, which breaks it anyways.

 

 

Ideas?

 

 

Thanks

 

Categories:
I have the same question (0)
  • Verified answer
    SCTdan Profile Picture
    604 on at

    I figured this out.  The issue was in trying to put the joined array (becomes a string at that point) back into an array or object variable.  That added the quotes, and I didn't notice, but it also escaped all my escaped characters.

     

    So instead, just write it to a string variable instead, then pass that string variable* as the POST body.  In hindsight, rather simple.  

     

    Lesson learned-  Just because you need to pass an object/array via POST (and you don't need to utilize it as an object/array inside flow anymore), doesn't mean it has to be an object/array inside Flow.  Not really a common issue though, just due to the unique batching syntax in mailchimp.

     

    mc-success.png

    mc-success2.png

     

     

    *You must pass a fully-formed query as a variable, it won't format properly when done like you see in the HTTP body heremc4.png

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 997

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 642

Last 30 days Overall leaderboard