Help

Airtable button triggering webhook Twice

Topic Labels: Automations
Solved
Jump to Solution
1333 3
cancel
Showing results for 
Search instead for 
Did you mean: 
spishu21
4 - Data Explorer
4 - Data Explorer

Hey guys, I have a button in my Airtable that triggers a Zap in Zapier. I'm using this code: { "https://hooks.zapier.com/hooks/catch/14888220/30r6035/?recordID=" & RECORD_ID() }, but it's triggering the Zap twice. I'm also using multiple buttons, and it's not working as expected. Can you help me troubleshoot this?

1 Solution

Accepted Solutions
TheTimeSavingCo
18 - Pluto
18 - Pluto

Could you provide a screenshot of your Zap history?  Bit of a long shot, but you could also try using a browser without any extensions on it; there was someone else who had a similar issue and it turned out they had a chrome extension that was triggering the webhook again for some reason.  Sadly, they never mentioned which extension it was though

Perhaps instead of using a button that opens a URL directly, you could use a button that runs a script extension and see whether the issue persists?  I've set it up for you here and you can find the code below:

 

let tableId = cursor.activeTableId
let table = base.getTable(tableId)
let record = await input.recordAsync("Pick a record", table)

let url = 'https://hooks.zapier.com/hooks/catch/14888220/30r6035/?recordID='  + record.id
console.log(url) 
await fetchData(url)

async function fetchData(url) {
  try {
    const response = await remoteFetchAsync(url);
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    const data = await response.json(); // Assuming the response is JSON
    console.log(data);
  } catch (error) {
    console.error("Could not fetch data:", error);
  }
}

 


--
What issue are you facing with the multiple buttons?

See Solution in Thread

3 Replies 3
TheTimeSavingCo
18 - Pluto
18 - Pluto

Could you provide a screenshot of your Zap history?  Bit of a long shot, but you could also try using a browser without any extensions on it; there was someone else who had a similar issue and it turned out they had a chrome extension that was triggering the webhook again for some reason.  Sadly, they never mentioned which extension it was though

Perhaps instead of using a button that opens a URL directly, you could use a button that runs a script extension and see whether the issue persists?  I've set it up for you here and you can find the code below:

 

let tableId = cursor.activeTableId
let table = base.getTable(tableId)
let record = await input.recordAsync("Pick a record", table)

let url = 'https://hooks.zapier.com/hooks/catch/14888220/30r6035/?recordID='  + record.id
console.log(url) 
await fetchData(url)

async function fetchData(url) {
  try {
    const response = await remoteFetchAsync(url);
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    const data = await response.json(); // Assuming the response is JSON
    console.log(data);
  } catch (error) {
    console.error("Could not fetch data:", error);
  }
}

 


--
What issue are you facing with the multiple buttons?

spishu21
4 - Data Explorer
4 - Data Explorer

@TheTimeSavingCo I tried using a diffrent browser, Now its working I am using a lot of extensions on chrome browser I am sure on of them is causing this (HTTP decoder chrome extension). 
Thanks for the solution.
I was using 3-4 buttons 
1. Getting data to sync for one row.
2. Sending webhook for creating invoices.
3. Sending email notifications.
4. Creating pdf documents
Now every button works.
Thanks for your time!! 😁