Creating new Drive Folder when a data is added in my sheet with my AppSheet App

JSTDC
New Member

Hey guys !
Sorry for my english, I’m french aha
I’m currently creating an app which will permit to create new folders in my Drive when a new data is added in my GSheet.

I created a workflow rule invoking the web hook.
I created the following app script : it works when i paste the URL in my browser but nothing appends when I create a data in my app.
I tried with a fake webhook from webhook.site and I saw that the hook is correctly called…

Can you help me ?

There is my app script :

//Creates a folder as a child of the Parent folder with the ID: FOLDER_ID
function createFolderBasic(folderID, folderName) {
  var folder = DriveApp.getFolderById(folderID);
  var newFolder = folder.createFolder(folderName);
  return newFolder.getId();
};

function creatNewFolderAppSheet(){
   //Add your own folder ID here: 
  var FOLDER_ID = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
  //Add the name of your folder here:
  var NEW_FOLDER_NAME = "Test From appsheet";
 
  var myTestFolderID = createFolderBasic(FOLDER_ID, NEW_FOLDER_NAME);
  var myClientFolderID = createFolderBasic(myTestFolderID,"CLIENT BLABLA");
  var myProjectFolderID = createFolderBasic(myClientFolderID,"PROJET BLABLA");
  Logger.log(myTestFolderID);

  return true;
}

function doPost(e){
  creatNewFolderAppSheet();
  return true;
}


function doGet(e){
  creatNewFolderAppSheet();
  return true;
}
0 4 332
4 REPLIES 4

I had posted this a while ago after I got my script to work Create folder structure in Gdrive and yours is very similar.

Please check the Audit History of AppSheet (Manage - Monitor - Audit History) to see if there was any error.

Thanks for your message !
I updated my script but I still ahve the same problem : my hook isn’t called…
I checked the monitor of my script and there was 0 calls from my appsheet…

Can you post your trigger condition for the webhook? Have you checked that the condition is TRUE?

JSTDC
New Member

I didnt’ put any condition aha

Top Labels in this Space