This is a Next.js application built in Firebase Studio to help you manage data in a Google Sheet.
- Open Google Sheets: Create a new Google Sheet or use an existing one.
- Open Apps Script: In your sheet, go to
Extensions > Apps Script. - Copy Script Files:
- Delete any existing code in the
Code.gsfile within the Apps Script editor. - Copy the content from
src/apps-script/Code.jsin this project into theCode.gsfile in the editor. - Create a new HTML file in the Apps Script editor by clicking the
+icon next toFilesand selectingHTML. Name itSidebar.html. - Copy the content from
src/apps-script/Sidebar.htmlinto your newSidebar.htmlfile. - In the Apps Script editor, open the
Project Settings(gear icon on the left) and check the box for "Showappsscript.jsonmanifest file in editor". - Return to the editor, and you will see an
appsscript.jsonfile. Copy the contents fromsrc/apps-script/appsscript.jsoninto it.
- Delete any existing code in the
- Deploy as a Web App:
- Click the
Deploybutton in the top right, then selectNew deployment. - Click the gear icon next to
Select typeand chooseWeb app. - For
Who has access, selectAnyone, Anonymous. - Click
Deploy.
- Click the
- Authorize Permissions: You will be prompted to authorize the script. Follow the on-screen instructions. You may see a warning that the app isn't verified; you can proceed by clicking "Advanced" and then "Go to (your project name)".
- Get Your IDs and URLs:
- After deploying, copy the Web app URL.
- Go to
Project Settings(gear icon) and copy the Script ID.
- Configure the Web App:
- Run this application.
- Navigate to the
/settingspage. - Paste your Sheet URL, Script ID, and Web app URL into the respective fields and click
Save Configuration.
- View Your Data: Navigate to the
/datapage to see the data from your sheet.