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

HTTP Post keeps adding a \ where a "

I've spent all evening searching for the answer on this one... please help.

 

I add this into a compose action:

[{"Group":2512276,"TimeSlot":"0"},{"Group":2517214,"TimeSlot":1"},{"Group":2513377,"TimeSlot":"3"}]

When the flow is ran, the body section of my HTTP post action, where the compose is inserted shows:

{
  "Name": "AA - 12220573_637004232000000000CG",
  "CustomerRef": 45345,
  "SiteID": 2243,
  "Access": "[{\"Group\":2512276,\"TimeSlot\":\"0\"},{\"Group\":2517214,\"TimeSlot\":1\"},{\"Group\":2513377,\"TimeSlot\":\"3\"}]"
}

 

See the screenshot below. How do I stop Flow from adding the \ to my post body?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User
Dual Super User

Re: HTTP Post keeps adding a \ where a "

Hey @MrRK 

 

You can go the variable way too. All you have to do is to intialize an array variable and keep appending the objects in that using the append to array variable action. 

 

Hope thsi Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

7 REPLIES 7
Highlighted
Super User
Super User

Re: HTTP Post keeps adding a \ where a "

Hi @MrRK 

 

Looks like your output of compose is fine. It is not adding the '/' character. How do you mapping the body of http? I can see there are other elements in the body such as Name, CustomerRef, SiteID. Could you please show a screenshot of this?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Highlighted
Dual Super User
Dual Super User

Re: HTTP Post keeps adding a \ where a "

Hey @MrRK 

 

For some reason that compose action is getting the input as string and that string is later being serialised in the HTTP action. I tried this by manually creating an array and typing the values in and it worked just fine.ww2.PNG

 

ww3.PNG

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Community Support
Community Support

Re: HTTP Post keeps adding a \ where a "

 

Hi @MrRK ,

 

I think the advice provided by yashag2255 is correct. You could use the variable of the corresponding type to store the property value, such as an object or array variable. 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.
Highlighted
Frequent Visitor

Re: HTTP Post keeps adding a \ where a "

You are correct, when the data is manually entered into a compose action, and then added to the HTTP Post, it works fine.

 

However, try initialising a variable, and setting the same values inside of a string. Then bring that into a http post in the same way, and it gets incorrectly formatted. I've tried everything to stop it happening and nothing works!

Highlighted
Dual Super User
Dual Super User

Re: HTTP Post keeps adding a \ where a "

Hey @MrRK 

 

You got it there-> "However, try initialising a variable, and setting the same values inside of a string. Then bring that into a http post in the same way, and it gets incorrectly formatted.The moment you add it as a string it will read it as one and add those extra characters to send a serialized body to the API call. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Frequent Visitor

Re: HTTP Post keeps adding a \ where a "

Awesome...

 

Ideally I'm trying to append to the Variable (String) based on various actions, and so Compose won't work for me.

 

What is the correct way?

Highlighted
Dual Super User
Dual Super User

Re: HTTP Post keeps adding a \ where a "

Hey @MrRK 

 

You can go the variable way too. All you have to do is to intialize an array variable and keep appending the objects in that using the append to array variable action. 

 

Hope thsi Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (7,038)