Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

POST to Zapier Webhook only works 33-50% of the time

Topic Labels: Scripting extentions
816 0
cancel
Showing results for 
Search instead for 
Did you mean: 
TWu
6 - Interface Innovator
6 - Interface Innovator

I’m trying to send data to Zapier’s webhook but it doesn’t seem to go through every single time. I’m a coding newbie, is there some sort of naive mistake I’m making below?

let result = new XMLHttpRequest();
let webhookURL = "https://hooks.zapier.com/hooks/catch/XXXXXX/YYYYY/";
let data = {
    "id" : record.id,
    "Format" : {name: record.getCellValueAsString("Format")}
};
await result.open("POST", webhookURL, true);
await result.setRequestHeader('Content-type','application/x-www-form-urlencoded');
await result.send(JSON.stringify(data));

I’ve noticed that it seems to make a difference if I have this command near the top of my script vs near the bottom.

0 Replies 0