I would like some help checking how many files are inside a Google Drive folder before allowing a form submission.
I would like that when the Submit
button is clicked, a function checks how many files exist in a child folder
of the folder where this GAS file is.
The HTML form GAS is linked to this worksheet here:
After checking how many files there are in the _
folder I would like to apply the following if/else
statements:
If the _
folder has more than 3
files, display a confirmation pop-up
, if the answer is Yes
, create any file in the _
folder, if the answer is No
, just don't allow the form submission.
If the _
folder contains 4
or more files, display an error message and disallow form submission.
The code of this HTML form can be seen here, accessing the spreadsheet's GAS:
From here, since the function can now return the count of files within the _
folder, you may need to create a new modal window on your HTML file to display the message first and create a separate function to determine the conditions for your if else statement.