cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jronash
Solution Supplier
Solution Supplier

There's a problem with the flow's trigger - When an HTTP request is received

I'm trying to use Automate to catch a webhook from MailChimp.  Everything sets up just fine - I have to set the trigger to "GET" so that MailChimp can validate the address, and then I switch it back to "POST".  If I put through a test event at this point, it comes through as expected.

 

But then I start building out the flow, and at some point the trigger breaks.  I haven't changed anything on the trigger, so there's no reason why it would suddenly stop working, but when I look at my run history, I see this message:

HTTPTrigger2.png

If I click Fix the trigger, I'm taken here.  No information about what's going wrong:

HTTPTrigger.png

 

I've tried with and without schema, changing various things around, nothing seems to fix it.  So I scrap the flow and start a new one, and the same thing happens.  It works at first, then I start building the flow and at some point it breaks. 

 

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Jronash
Solution Supplier
Solution Supplier

Hello @pepeday - I guess I never updated this post.

 

It turns out that this isn't isn't caused by the method of the call, but the presence of form data within the call.

 

For some reason, if the HTTP call that triggers the flow includes form data, your flow will break IF you have any other connections in use on the flow.

 

If you don't have any other connections, the flow will run just fine.

 

So the workaround to this problem is annoying, but it's been working well for me - split your flow into two separate flows.

 

The first flow catches the POST call from your webhook.  Don't add any other connections to this flow.  The only thing you want to do is take the data that you need from your trigger and pass it to your second flow.  I use the HTTP action to do this.

 

In your second flow, you add any connections that you need, and process the data there.

 

Hope it helps.

View solution in original post

11 REPLIES 11
yashkamdar
Solution Sage
Solution Sage

Hello Team,

 

Something doesn't add up here, your method in the action should be GET and not POST.

 

I tried the same thing and with the GET method it worked just fine for me, see below-

 

yashkamdar_0-1599773706333.png

 

 

If you try the POST method on top of Get HTTP request, it is going to fail because the expected method in never POST.

 

You might get an error like this-

 

yashkamdar_1-1599773766819.png

 

 

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!

 

MailChimp uses a GET request for the first call - just to validate that the URL is valid. After that, all of the calls are POST.

 

From their website:

"Webhooks are a helpful tool that you can use to collect information about audience changes in Mailchimp as they happen. By entering a valid URL that’s set up to accept HTTP POST requests, you can receive updates on subscriptions, changed email addresses, campaign sending, and more. "

Hello Team,

 

But there is nothing configured to POST in that action is what seemed weird to me. 

 

yashkamdar_0-1599774436317.png

 

You have configured the method post, but what should it post.

 

I would rather suggest, you to configure the method as GET and then create a seperate method that lets you POST as shown in the figure below-

 

yashkamdar_1-1599774590651.png

 

Make sure you properly configure your POST request.

 

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!

I appreciate your time, yashkamdar, but I don't think you fully understand the functionality of HTTP trigger.

 

The HTTP trigger does not send calls, it receives them.  When you set the trigger to GET or POST, you are telling it what sort of calls it should expect to receive.  Another service (in this case MailChimp) actually makes the calls, the trigger only receives them.

pepeday
Helper I
Helper I

Hey, I'm having the same problem as OP. The trigger only runs once then is never triggered again. I've tested my POST responses with a webhook service and it all seems to run fine.

 

The only way I can get it to work again is if I create a new flow and then it only works once again.

Jronash
Solution Supplier
Solution Supplier

Hello @pepeday - I guess I never updated this post.

 

It turns out that this isn't isn't caused by the method of the call, but the presence of form data within the call.

 

For some reason, if the HTTP call that triggers the flow includes form data, your flow will break IF you have any other connections in use on the flow.

 

If you don't have any other connections, the flow will run just fine.

 

So the workaround to this problem is annoying, but it's been working well for me - split your flow into two separate flows.

 

The first flow catches the POST call from your webhook.  Don't add any other connections to this flow.  The only thing you want to do is take the data that you need from your trigger and pass it to your second flow.  I use the HTTP action to do this.

 

In your second flow, you add any connections that you need, and process the data there.

 

Hope it helps.

View solution in original post

Hi

How did you compose that HTTP step that redirects the information for the second flow?

If I put the Body in there and the second flow has a connection to excel, email, etc I keep getting the same error. Feel like I am stuck on a loop.

 

Thanks

Jronash
Solution Supplier
Solution Supplier

@cjhenrique, if you pass the Body without modifying it first, you'll end up with the same problem, since you'll still be dealing with form data.

 

You'll need to extract the values you need from the form data and pass them to your new form in a JSON object.  If you're not sure how to do that I can provide more detail.

Thank you for the quick reply!

 

Yes I am kind of clueless because I only know the basics of basics...

Which steps should I use exactly?

If you open one of your past runs and look at the trigger body, you should see a section that looks something like this:

  "$formdata": [
    {
      "key": "type",
      "value": "unsubscribe"
    },
    {
      "key": "name",
      "value": "John Smith"
    }
  ]

 

Identify the values you will need for your second flow.  You can extract them from your form data by using the triggerFormDataValue() expression.  For instance, if I wanted to reference the name from my form data, I could use this expression:

triggerFormDataValue('name')

 

You see?  You reference the Key, and the expression returns the Value.

 

Using this, you can reformat the data you need into a JSON object that you pass to your second flow in the body of the HTTP action.  It would look something like this:

{
  "name": [[triggerFormDataValue('name')]],
  "type": [[triggerFormDataValue('type')]]
}

I put the expression in double square brackets to show that they are supposed to be expressions - don't put the double square brackets in your actual HTTP body.  In PA, it will look like this:

trigger.png

 

If you aren't used to working with these sort of data structures, this might be a bit confusing.  But hopefully there's enough here to get you started.

This helped me a lot. I was struggling with figuring out what to put in the body as JSON, but now things are clear.

I have many fields and it is going to be a bit long JSON. I am going to try it out and give feedback.

EDIT: @Jronash I just tried it with just a bunch of fields and it's working! Perfect!

Thank you once again!

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,155)