How to use button function linked with a webhook for generating contracts or invoices

I’ve given it a test and it works wonderfully :tada:
What’s especially key is that I’ve managed to set up a fail-safe mechanism. This is crucial because, in Airtable, I frequently use such a button linked with a webhook for generating contracts or invoices, and it’s important to guard against unintended clicks.

Here’s a guide for others on how to do this:

  1. First, add a checkbox field (a boolean in Baserow). I will name the field ‘Check’. You can use any other name you need)

  2. Then, create a formula field using this example:

    IF(field(‘Check’),
    button(‘http://google.com’, ‘:rocket: rocket launch’),
    button(‘’, ‘:rocket: rocket launch’))

    Feel free to replace ‘http://google.com’ with any URL you need. I use a webhook URL here to trigger actions in n8n. And button text of course)

  3. When the checkbox is unchecked, the button stays inactive. Once checked, it becomes active – a very convenient setup. In n8n, after completing the necessary logic, I include a step to uncheck the checkbox automatically, deactivating the button.

This approach ensures the button is only active when needed, minimizing the risk of accidental activations.

In the screenshot below, you can see that the buttons next to the unchecked checkboxes remain inactive.

2 Likes

Hi @Alexander,

Thanks for sharing this flow.

I’m looking to do something similar…
Could you please elaborate on how you structured the webhook request in the button link?

Thanks,
Dominic

Hi! Sure!

:one: Always active button with webhook:

button(CONCAT(‘https://n8n.my.server/webhook/cd19bfac-7f0c-4bd6-baf2-7c1095087144789321?database_id=77&table_id=232&record_id=',field('Row(ID)’)), ‘:radio_button: BUTTON :radio_button:’)

:two: Button with webhook active only then a checkbox field is on.

IF(field(‘Activate buttons’), button(CONCAT(‘https://n8n.my.server/webhook/cd19bfac-7f0c-4bd6-baf2-7c1095087144789321?database_id=77&table_id=232&record_id=',field('Row(ID)’)), ‘:radio_button: Create oferta :radio_button:’), button(‘’, ‘Create Oferta’))

it will look like this:

Did I manage to answer your question? Or you need some more specific info?

1 Like