Hey there, the thing is your apps script project has 3 problems.
The first problem is that you forgot to add parameters between event and nom/prenom.
The second problem is to rename event to e.
Fixed code:
function doPost(e) {
var nomClient = e.parameters.nom;
var prenomClient = e.parameters.prenom;
DriveApp.createFolder("Mr " + nomClient + " " + prenomClient);
};
The third problem is that in Thunkable you put the wrong URL in the API URL. In order to put the correct URL, you need to publish you Apps Script problem as a web app.
Steps:
To deploy a script as a web app, follow these steps:
At the top right of the script project, click Deploy > New deployment.
Next to “Select type,” click Enable deployment types settings > Web app.
Set “Execute as” to Me and then set “Who has access” to Anyone
Click Deploy.
Then just paste the URL you get into the Web API’s URL block you have.
Thanks for your solutions, i think my URL is good now.
But for my queryparameters in thunkable view, it’s not copy to my script on google, i don’t understand why… An idea ?
This next view is my fonction to post on my Google drive.
The purpose of this function is to retrieve all kinds of information stored in my sthunkable variables to my script in order to be reprocessed later.
There is also a sending of these variables to a google sheets in order to have a register of requests sent via the thunkable application. Which, by the way, works very well!
Probably my problem is on that part with a wrong url ? I don’t know how to put a right url with a key finding on google drive api. Do you have a method to explain to me ?
You dont need to put the google drive api in thunkable. You can just enable the google drive api on the left side of apps script where it says services.
What I don’t understand is that with my current thunkable code and my script, as soon as I simulate with my mobile phone, I should have my script that is triggered and create a folder for me with the first and last name with my variable from thunkable?
But none of this, so I guess my variables don’t make it to the script.
and when i submit by thunkable on mobile, it works halfway. This creates a folder for me at the root of my google drive with the first and last name that I entered in thunkable, however afterwards it blocks on the sheet creation line. I feel like it was like the value of the variables jumped to the previous line…
You can see the script with constant variable do perfectly the task. My problem, i think, is between thunkable and my script. My script can’t get receive variable or thunkable does anything…