Hi there,
As the title says, I'm trying to send a POST request using Fetch to a Zapier webhook. This works fine, except when the Fetch is placed inside a function, it is never sent.
Checking the network log, the request seems to be stalled indefinitely.
I tried sending the request using the same code outside of Airtable, and it's working. The request is sent to Zapier.
I've scoured Google looking for similar issues but couldn't find anything relevant. I tried async and not, try/catch, and adding headers, but nothing so far.
Has anybody encountered this issue before?
Appreciate any help and suggestions 🙏
let table = base.getTable("Testable");
let record = await input.recordAsync('Select a record to use', table);
let bugID = record.getCellValueAsString("Bug ID");
let kustomerLink = record.getCellValueAsString("Convo Link");
if (kustomerLink) {
sendReport(bugID, session.currentUser.name, kustomerLink);
} else {
kustomerLink = await input.textAsync('Please paste a link to the ticket')
.then((r) => {
sendReport(bugID, session.currentUser.name, kustomerLink);
})
}
async function sendReport (jiraID, agentName, customerLink) {
console.log("Sending...", jiraID, agentName, customerLink)
try {
bug: jiraID,
agent: agentName,
kustomer: customerLink
})});
console.log(await response.text());
} catch (e) {
console.log('error', e);
}
console.log("Sent")
}