UDMI / Docs / Tools / BAMBI Sheet Interface Setup
This guide provides instructions on how to set up a Google Sheet to communicate with the BAMBI backend service.
The setup involves two Google Apps Scripts that work together:
We use two separate scripts because a script must be linked to a Google Cloud Platform (GCP) project to get permission to publish messages. By having one central PubSubPublisherWebApp
, multiple users can create their own BAMBISheetsInterface
sheets without needing complex GCP configurations.
Follow these instructions to create your own copy of the BAMBI sheet.
This method uses a Python script to create and configure your new BAMBI sheet automatically.
Before running the script for the first time, you must enable the Apps Script API. If you do not want to enable the Apps Script API in your project, you can jump to the Manual Setup.
${GCP_PROJECT_ID}
with your actual Google Cloud Project ID.
https://console.developers.google.com/apis/api/script.googleapis.com/overview?project=${GCP_PROJECT_ID}
https://script.google.com/home/usersettings
Authenticate with Google Cloud: Run the following commands in your terminal to log in and set the correct permissions.
gcloud auth login
gcloud config set project ${GCP_PROJECT_ID}
gcloud auth application-default login \
--scopes="openid,[https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spreadsheets,https://www.googleapis.com/auth/script.projects,https://www.googleapis.com/auth/drive.metadata.readonly](https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spreadsheets,https://www.googleapis.com/auth/script.projects,https://www.googleapis.com/auth/drive.metadata.readonly)"
Run the Creation Script: Execute the Python script to create the sheet. Replace ${UDMI_ROOT}
with the path to your UDMI root directory and provide a title for your new sheet.
# Activate your virtual environment
source ${UDMI_ROOT}/venv/bin/activate
# Run the script
python ${UDMI_ROOT}/misc/bambi_appscript/create_bambi_sheet.py --sheet_title "Your New Sheet Title"
✅ Once the script finishes, you should see the BAMBI menu ready as well as input tabs populated on your sheet.
Remember to share it with the service account used by the backend service! If not shared, the backend will not be able to read from and write to the sheet.
Follow these steps if you prefer to configure the sheet manually or if you do not want to enable the Apps Script API in your GCP project.
<>
icon). Replicate all the files from the ${UDMI_ROOT}/misc/bambi_appsscript/bambi_sheet
directory into your Apps Script project.
PUBSUB_WEB_APP_URL
in the Constants.gs
file with your custom URL.✅ The BAMBI menu should now appear, and your sheet is ready with the input sheets.
Remember to share it with the service account used by the backend service! If not shared, the backend will not be able to read from and write to the sheet.
This section is optional. You only need to follow these steps if you cannot use the pre-deployed PubSubPublisherWebApp
and/or need to host your own.
gcloud auth login
gcloud config set project ${GCP_PROJECT_ID}
gcloud auth application-default login
Create a New Apps Script: Go to script.new.
<>
.${UDMI_ROOT}/misc/bambi_appsscript/deps/PubSubPublisherWebApp/appsscript.json
into your appsscript.json
file.${UDMI_ROOT}/misc/bambi_appsscript/deps/PubSubPublisherWebApp/Code.gs
into your Code.gs
file.Constants.gs
file in any BAMBISheetsInterface
script that uses this custom publisher.