Forum Discussion
Help : Create POST api request using double quotes in body to format payload
- 6 years ago
I think the issue is that you are double formatting the data.
Remove:
body = GetJson(#"Promoted Headers"),change
Content = Text.ToBinary(body)to
Content = Json.From(#"Promoted Headers")And hopefully that should work.
Actually, looking into this further. You need to use a single row in a table, not the entire table... E.g.
change
Content = Json.From(#"Promoted Headers")to
Content = Json.From(#"Promoted Headers"{0})if you just want to use the first row of the table.
I think the issue is that you are double formatting the data.
Remove:
body = GetJson(#"Promoted Headers"),
change
Content = Text.ToBinary(body)
to
Content = Json.From(#"Promoted Headers")
And hopefully that should work.
Actually, looking into this further. You need to use a single row in a table, not the entire table... E.g.
change
Content = Json.From(#"Promoted Headers") to
Content = Json.From(#"Promoted Headers"{0})
if you just want to use the first row of the table.
Thank you so much for your help. Using your suggestion I get the error :
Expression.Error: The name 'Json.From' wasn't recognized. Make sure it's spelled correctly.
I tried
Content = Json.FromValue(#"Promoted Headers"{0}) And got the same view of the fields with no values.