Open bingaman opened 2 years ago
Here's what I did to make it write all permissions:
Replace: https://github.com/usaussie/appscript-google-shared-drive-inventory/blob/c32fbc3480af934b30d9f821d7a577b977a540de/Code.gs#L111 with: var lastRow = rangeData.getNumRows(); var driveCount = lastRow - 1;
Use driveCount instead of the this constant: https://github.com/usaussie/appscript-google-shared-drive-inventory/blob/c32fbc3480af934b30d9f821d7a577b977a540de/Code.gs#L12 in: https://github.com/usaussie/appscript-google-shared-drive-inventory/blob/c32fbc3480af934b30d9f821d7a577b977a540de/Code.gs#L112 and in: https://github.com/usaussie/appscript-google-shared-drive-inventory/blob/c32fbc3480af934b30d9f821d7a577b977a540de/Code.gs#L119
This is will prevent the script from using a blank Drive ID for the permissions query if your Shared Drive list is fewer than the value of NUMBER_OF_ROWS_TO_LOOKUP_PERMISSIONS_PER_LOOP.
Thanks for the heads up on this issue. -- if you want to add this as a pull request, i'll review again and accept/merge it.
You're overwriting the permissions row on each loop so it just ends up showing one permission per shared drive
https://github.com/usaussie/appscript-google-shared-drive-inventory/blob/6041c5e0eac0ea85723fe9ba94cc83d367af621a/Code.gs#L150