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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Having Trouble Passing...
Power Automate
Unanswered

Having Trouble Passing JSON Data via Invoke Web Service

(3) ShareShare
ReportReport
Posted on by 65
I'm having problems using the Invoke Web Request step. I have this AI generated cURL command that works as expected [1]:
curl -X POST https://adb-<workspaceId>.azuredatabricks.net/api/2.0/sql/statements/ \
-H "Authorization: Bearer <myPersonalAccessToken>" \
-H "Content-Type: application/json" \
-d '{
  "warehouse_id": "<myWareHouseId>",                                                                                     
  "catalog": "hive_metastore",                                                                                            
  "schema": "dev.bronze",                                                                                              
  "statement": "SELECT * FROM dev.bronze.shawn_test_table;"
}'
Unfortunately, I can't get it to work correctly in Power Automate (See Picture Below):

When I run the Power Automate debugger and stop in the Set Variable step, I see that my WebServiceRequest variable was set to the value:
{"error_code":"MALFORMED_REQUEST","message":"Invalid JSON given in the body of the request - failed to parse given JSON"}

This implies that the Invoke Web Service request step failed. I suspect the problem is that I'm not formatting my JSON the way Power Automate wants me to in the Request Body field of the Invoke Web Service dialog. When I use the real values for <myPersonalAccessToken> , <workspaceId> and <myWareHouseId> my JSON is valid, but I do have a few questions:
  1. Does Power Automate require me to format the JSON for my Request Body in some special manner?
  2. Am I using the proper method to pass JSON via Invoke Web Service?
If you are interested, you can also see a slightly modified version of this question here on StackOverflow (SO):
https://stackoverflow.com/questions/78903351/how-do-i-pass-json-data-in-the-desktop-version-of-power-automate

[1] - The query has been sanitized to remove sensitive data prior to posting here and on SO.
I have the same question (0)
  • Suggested answer
    shawn_eary Profile Picture
    65 on at
    I was talking with MS Copilot and it suggested I check the Encode Request Body switch and turn it on. It was already on. It turned it off and the code started working.

    Apparently, the setting was on by default in my code.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard