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 / "When a HTTP request i...
Power Automate
Unanswered

"When a HTTP request is received" trigger breaks with SharePoint

(0) ShareShare
ReportReport
Posted on by 5

I'm trying to build a Flow which populates a SharePoint List from a submitted web form using When a HTTP request is received.

 

The flow works fantastically until I add a SharePoint Create item trigger. Then, I immediately start getting a BadRequest error on the trigger with no other explanation. I've tried rebuilding from scratch but I get the error as soon I add the Create item action.

 

Do I need to add some kind of authentication to the request in order to use the SharePoint connection?

 

Any help would be much appreciated.

 

rrunnels_0-1605208342397.png

 

Categories:
I have the same question (0)
  • rrunnels Profile Picture
    5 on at

    I found the problem - it was an issue with jQuery in the calling code. For anyone interested:

    The $.ajax() function has a dataType property that I set to "json" thinking that it would automatically set the header's content-type, but it actually only sets the data type expected in the return. The default content-type is "application/x-www-form-urlencoded".

     

     

    $.ajax({ 
     type: "POST", 
     url: $(this).attr("action"), 
     dataType: "json", 
     data: json_obj, 
    })

     

     

    This worked at first, but made the properties very difficult to access in Power Automate, which should have been my first clue. Then, of course, adding a SharePoint or SQL Server connector caused the whole flow to fail with BadRequest.

    To solve the problem I added a contentType property set to "application/json" and converted the payload from a json object to a string:

     

     

    $.ajax({
     type: "POST",
     url: $(this).attr("action"),
     dataType: "json",
     contentType: "application/json; charset=utf-8", // Set the content-type
     data: JSON.stringify(json_obj), // Stringify the output
    })

     

     

     

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard