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

BadRequest Error for "When a HTTP request is received" with $formdata

I'm having trouble with the "When a HTTP request is received" premium trigger.  I think that the problem is rooted in the fact that the POST request that should trigger the event is given as formData.

 

I followed the instructions here which works wonderfully for the test data that I had

https://medium.com/@edmyersjr/a-better-way-to-work-with-form-data-in-microsoft-flow-triggers-214c7f8...

 

But then for some unknown reason after a save the trigger stopped working properly and now continually gives me a "There's a problem with the flow's trigger. Fix the trigger , Learn more" error message on under the run history without even logging that the run failed.  I set up a capture on pipedream.com to ensure that the messages were coming through correctly and they were coming through correctly structured and consistent with when I was expecting them, just power automate does not seem to be able to handle them anymore.

 

Any help is appreciated.   Is there a way to fix this or is there an alternate to the HTTP Request that will handle form data correctly?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Pstork1 I must apologize. I believe that you were on the right track with the connection/authentication issues.  After recreating the flow I found that as soon as I added a SharePoint connector it started failing with the bad request error.  My final solution was to split the process into two where the first flow receives the request with form data and extracts the relevant parts, it passes these to a second flow through a second HTTP request trigger with a proper JSON body which is parsed and passed to other steps which require connections (in my case creation of a SharePoint list item).

View solution in original post

9 REPLIES 9
Dual Super User III
Dual Super User III

Check the connection being used by the Trigger.  In my experience this error usually happens when security in the connection fails and needs to be re-authorized.  Click the ellipse, three dots on the upper right of the trigger, and make sure the connection that is checked doesn't say invalid connection.  If it does click on the invalid and re-authenticate the connection. 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

There is no connection for the trigger it is a 'When a HTTP request is received' trigger which requires no special permissions or connections just waits for an event to be posted to the provided URL.

@Pstork1 I must apologize. I believe that you were on the right track with the connection/authentication issues.  After recreating the flow I found that as soon as I added a SharePoint connector it started failing with the bad request error.  My final solution was to split the process into two where the first flow receives the request with form data and extracts the relevant parts, it passes these to a second flow through a second HTTP request trigger with a proper JSON body which is parsed and passed to other steps which require connections (in my case creation of a SharePoint list item).

View solution in original post

Dual Super User III
Dual Super User III

Glad you were able to work it out.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

 


@AndrewRedd wrote:

  My final solution was to split the process into two where the first flow receives the request with form data and extracts the relevant parts, it passes these to a second flow through a second HTTP request trigger with a proper JSON body which is parsed and passed to other steps which require connections (in my case creation of a SharePoint list item).


While this works round the problem, surely it also indicates a bug in the MS Automate Flow implementation doesn't it? If the trigger works *before* you add in your SharePoint step, then it makes no sense that it returns "BadRequest" on adding in a step downstream from the trigger firing?

 

(I have exactly the same problem!)

I have the same exact problem too. Have you found any workarounds? I would prefer to keep everything in one flow! Definitely a Microsoft Bug.

Advocate IV
Advocate IV

I am having the same problem.

@AndrewRedd Would you mind explaining how you created the second flow using the JSON processed in the first?

Nevermind. I answered my own question. For anyone that is interested in my resolution.

HTTP Request at the end of the first flow. Sends the JSON from the Output of the compose function above it.HTTP Request at the end of the first flow. Sends the JSON from the Output of the compose function above it.

Start of the second flow. Generated json schema using a test output from the initial flow. Connected the HTTP trigger to the end of the first flow.Start of the second flow. Generated json schema using a test output from the initial flow. Connected the HTTP trigger to the end of the first flow.

 



 

Frequent Visitor

Still no solution? (Other than OPs workaround solution).

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (25,891)