What are you trying to achieve?
Hi!, I want to run my App Script via make.com. I have data on a sheet, but i want to run it via make.com so it will proceed next steps in workflow. How can I do that?
Hi!, I want to run my App Script via make.com. I have data on a sheet, but i want to run it via make.com so it will proceed next steps in workflow. How can I do that?
Hi @Piotr_Jablonski, Youâll have to Deploy your AppScript as a webapp.
Then youâll get the link after deployment. Thatâs your âwebhookâ to send HTTP POST request to :
One of functions I call in my appscript looks like this :
function doPost(e) {
// Parse the incoming parameters or data
var action = e.parameter.action; // Get the 'action' from the webhook
var type_vehicule = e.parameter.type_vehicule; // Get 'type_vehicule' from the webhook
var nom_vehicule = e.parameter.nom_vehicule; // Get 'nom_vehicule' from the webhook
var result;
// Route the request based on the "action" parameter
if (action === "majPlanning") {
result = majPlanning(type_vehicule,nom_vehicule); // Call insertVehicle function with the passed type_vehicule
} else if (action === "majFormulaires") {
result = majFormulaires();
} else {
result = "Unknown action";
}
// Return the result
return ContentService.createTextOutput(result);
}
The HTTP POST request module looks like this :
Mention me if you need more help.
Unfortunately, i have error (it seems that there is problem with permission). Claude and GPT is not helping Do you have any idea what should i check? When i made new deployment, i changed:
âExecute asâ to Me
âWho has accessâ to Anyone
@Piotr_Jablonski, Try setting body type = empty? Did you deploy as a web app ? I just repeated the process and it worked, I donât think thereâs any more to it. Me and Anyone are good.
i tried with body type = empty. Yeah, i deployed as a web app. Still the same error.
@Piotr_Jablonski, Did you try executing the script inside apps script ? You might not have authorized the app first. You know, when you launch any script for the first time. Thatâs my last resort. Lol
Script is working (it was my first guess ). Also, i tried with with GET, to check if URL is working (it isâŚ)
@Piotr_Jablonski, How did you launch the script ? With post request or manually in apps script ? Iâm talking about the authorization window youâre getting when launching the script manually. Maybe I misunderstood your reply and maybe you already authorized.
Can you try sending a post request from Postman to test the webhook link ?
sure i can, i lunch the script manually in app script. In Postman there is the same error (401 Unauthorized)
@Piotr_Jablonski, Wait⌠can you remove try-catch ? The error might be from the analyzeBookingPlatforms() function⌠what does the function do, does it call more APIs after ?
analyzeBookingPlatforms() is my main function which i want to run.
@Piotr_Jablonski, Iâm pretty sure the error comes from the function analyzeBookingPlatforms(). You can know this by going in âExecutionsâ on your left sidebar in apps script. Your doPost() request may execute successfully, but maybe thereâs 401 error in your analyzebookingplatforms() request (assuming itâs calling some other API which you donât have correct auth token).
I changed code, it is working. Thank you !!!