Feb 22, 2023 04:24 AM
I previously had this automation working but has for some reason stopped working. Although the file name is uploaded, the isn't actually anything in the image file. Process is click on the 'Process PSDs' button and this fires a webhook to make, which then uploads to s3.
This is the script that runs on button click:
// ----------------------------------------------------------------------------
// 🚨 STEP 1. 🚨
// Change 'Test' to the name of your table.
let table = base.getTable('Pre Mock Prod (PB)');
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// 🚨 STEP 2: 🚨
// Change the following url to your Zapier webhook.
// To get a Zapier webhook, click the below link, then choose "Catch Hook" as the trigger event
// https://zapier.com/app/editor?create=true&template__0__selected_api=WebHookAPI
let webhook_url = 'https://hook.eu1.make.com/o2svol1v14x7i3xoezllg390l8decek5'
// ----------------------------------------------------------------------------
let record = await input.recordAsync('Process PSDs', table);
let record_id = record.id;
// ----------------------------------------------------------------------------
// 🚨 STEP 3. 🚨
// Add all the fields you want to send over to Zapier. Follow the format:
// let record_FIELDNAME = record.getCellValue(FIELDNAME);
let record_mockup_id = record.getCellValue('mockup_id');
let record_mockUpFiles = record.getCellValue('mockUpFiles');
// ----------------------------------------------------------------------------
const customFetch = async (
record,
) => {
const url = webhook_url;
console.log("F url:", url);
const options = {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
record_id: record_id,
// ----------------------------------------------------------------------------
// 🚨 STEP 4. 🚨
// Pass in the fields you want to use in the Zapier Zap
// Format it like --
// record_FIELDNAME: record_FIELDNAME,
record_mockup_id: record_mockup_id,
record_mockUpFiles: record_mockUpFiles,
// ----------------------------------------------------------------------------
}),
};
const response = await remoteFetchAsync(url, options);
const result = await response.json();
return result;
};
let result = await customFetch(record);
console.log(result);
output.markdown(`# You have selected ${result}.`);
This is what I have in Make which could be where the issue lies.
I've tried all sorts of configurations but I just get the same empty file uploaded to s3.
Feb 22, 2023 09:41 AM
Did this workflow used to work? Does the Make scenario show any errors?
If you try it again a few hours later, does it work?
I noticed a couple days ago that the attachment urls that I was getting from scripting in one particular base (not others) were already expired. Then the issue resolved itself by the next day and the system worked correctly with no changes. Could something similar be happening for you?
Feb 22, 2023 01:07 PM
Hey Kuovonne, no errors at all. And no it's not been working for a few days. I think a better solution is going to be creating an AWS API gateway. I had another related post on this so will reference the entire solution once its sorted.