Button Activated Webhook Thoughts

(Scroll to the bottom for the “bottom” line… The “best” way to call a webhook with a button column.)

The somewhat long story…

In the past I’ve needed to call a webhook based on a button column click.

My approach was to create a seperate work status column that I would change with the required automation for the button click. I would then have an integration that would call the webhook when that work column changed. A little clunky. But, it worked.

Recently, I had the same need but have come up with a better way to do it.

I found that the button column “value” actually changes every time you click it. So, I could use that for the integration trigger. But, you still have to have an attached automation for the button. I looked at the actions available and thought that the Notify action was the least messy and used that thinking that I could just ignore the notifications.

I didn’t like the notifications. I thought who else could I send this to? I didn’t want to create a dummy user just for this. Then it occured to me that I could send it to a team with no one in it. Added the team, changed the automation, tested it. It works. No extra column. No unwanted notifications.

… posted this…

… then Bas got involved and I found a better “best” way… (now included in the Bottom Line)

*********************************** The Bottom Line ***********************************
The “best” way to call a webhook with a button column.

  • Create a button column. Use the recipe: When Buttomclicked and Status is Done and Status in not Done notify anybody. (As can be seen, the notification will never be sent.)
  • Create an integration: “When {button column} changes, send a webhook”

That’s it. QED
(Edited to include the NEW better “best” way.)

4 Likes

Hi @JCorrell
I did some testing few weeks ago and when you create a webhook through the API you can use a button column in the API call, like:

mutation { create_webhook ( board_id: 12593, url: "https://www.webhooks.my-webhook/test", event: change_specific_column_value, config: "{\"columnId\": \"button\"}") { id board_id } }

There is no need to “configure” the button through the API, once the webhook is hooked up pressing the button will just fire the webhook. And indeed, the even contains the number of times the button is clicked.

2 Likes

@basdebruin,

First in trying to understand your comment, I found a better “best” way…

Because the required button automation is a “custom” automation, you can add mutually exclusive “and” criteria that will insure that though the integration gets called the automation action never will. (Now included in the “best” way above.) As follows:

Second, I’m not sure I understand your comment completely. I thought that what you were saying was that by creating the webhook using the API you would not have to attach an automation to the button. In testing, I did find that the integration will work without the automation attached to the button. However, everytime I click it, it also brings up the button automation setup screen. Did I misunderstand or am I missing something?

hi @JCorrell

You understand correctly… until I tested further. I have indeed boards where adding a webhook through the API when the user selects the recipe (custom trigger - add webhook in subscribe event) makes the button work WITHOUT the button automation setup window. However, on a new board with a new recipe I does popup with the automation setup window. I can’t get my head around this one. Maybe @monday-team can shine some light here.

To summarize:

  • integration with custom trigger, custom action
  • recipe with a button column
  • subscribe event create a webhook, type: change_specific_column_value to an endpoint

In all cases clicking the button will fire the trigger and the webhook endpoint receives the event.

In some case clicking the button shows the button setup window, and in some case it does not show this setup window.

To add some more detail. In boards where I can add (through the API) a webhook to a button - WITHOUT having the button automation window popping up on click - I see the following when selecting the column settings for the button.

image

As you can see the recipe itself is the automation setup for the button. The question is: why i sthis working on some boards and not on others?

@AlexSavchuk one for you? :slight_smile:

Sorry for the late reply here, we missed it because it was originally not in the Developer’s Category.

I suspect the difference in UI is due to a change in the column behaviour. Sometimes we choose to release features that only affect new columns (so that existing ones won’t break).

Is this feature not working the way you expect, or was it just a clarifying question?

1 Like

Hi @JCorrell!

Since it’s been a while since we’ve heard back from you, I’m going to mark one of the previous comments as the solution.

If this issue is still ongoing, feel free to make a new comment within a week, or start a new thread.

Thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.