( I will assume here you are using new interface version "v8 / 2021")
- Make a spreadsheet with a desired name, keep same name for script.
- Copy all of the files from this repo as their own files in appscript, save everything.
- Run code from templates.gs It will make all spreadsheets for you.
We will need proper working OAuth from https://github.com/googleworkspace/apps-script-oauth2 Click "+" next to "Libraries" and search for script ID "1B7FSrk5Zi6L1rSxxTDgDEUsPzlukDsi4KGuTMorsTQHhGBzBkMun4iDF"
Grab your Redirect URI that will be: https://script.google.com/macros/d/{SCRIPT ID}/usercallback It will be in settings, you will need that later.
We will follow instructions from: https://cloud.google.com/identity/docs/how-to/setup-devices
Go to your org's GCP and find this script. Assuming you have required access you can see all resources here: https://console.cloud.google.com/cloud-resource-manager Click on the project name (or domain) in top left corner. In popup window search for your project name. If you have a lot of them you can find it by a name (for me "_" got changed to " ")
You now have a project selected, make sure billing is assigned.
Enable Cloud Identity API as per that manual Configure service account. Save JSON credentials, you will need them in a moment
Out of those credentials you will have to add few to Script Properties please refer to "main.gs" Save with same name: client_email client_id private_key - when saving this one copy whole things including brackets on both ends ""
---------- Redirect URI (in your GCP) ----------
Go to your org's GCP and find this script. Assuming you have required access you can see all resources here: https://console.cloud.google.com/cloud-resource-manager Click on the project name (or domain) in top left corner. In popup window search for your project name. If you have a lot of them you can find it by a name (for me "_" got changed to " ")
-
OAuth consent screen Create OAuth consent screen at: https://console.cloud.google.com/apis/credentials/consent?project={Project ID} Click "Make Internal" - it will save you a lot of hassle Click "Edit APP" on top next to the name rename if it was "Untitled project", I use "ORG Device manager" Add domains if you like, most settings can be ignored. Next Ignore Scopes, manifest should take care of that. Next > Back to dashboard
-
Get OAuth client ID Go to "Credentials" on the left https://console.cloud.google.com/apis/credentials Click "+ Create Credentials" > "Create OAuth client ID" Web Application Reasonable name Create Authorised redirect URIs = https://script.google.com/macros/d/{SCRIPT ID}/usercallback Copy client ID and Client Secret or download all as JSON. You will have to decide how to store/access those. For this code we will use "scriptProperties", please refer to "main.gs".
Google sheet should have a new menu on top called "Script" All options in it should be self descriptive.
TODO: add more info here