Having the Spreadsheet Auto-Update

Usually, when you make changes to a spreadsheet that you're using with Capri, you need to delete and reupload the spreadsheet to the portal for those changes to be updated in Capri, but there is a way to have the spreadsheet auto update whenever changes are made!

The first thing you need to do is go to the spreadsheet that you're using, select extensions at the top, then apps script.

This will bring you to a page with code on it that looks like this.

Delete the code that's already there, then go to the page https://github.com/Capri-Ai/Knowledge-Updates/tree/main/CapriGPT(Beta) and select beta_script.js This will bring you to a page with code on it.

This may seem like a lot, but don't worry, all you'll be doing is copying and pasting this code! From here, what you need to do is click the two squares in the top right to copy this code, and then you can go back to the apps script page and paste it in!

Next, open a new tab and go to the Capri portal, then navigate to the "organizations" tab on the left, then select "tokens" and add a new token.

Copy this token by clicking the two squares, then go back to the apps script page and scroll down to find line 41 where 'YOUR_CAPRI_TOKEN' is displayed.

Replace YOUR_CAPRI_TOKEN with the token you copied from the Capri portal, making sure to keep the apostrophes on the edges.

Afterward, save the script by clicking the floppy disk at the top, then click "deploy" and "new deployment."

From here, click the gear button and select "Web app" and then for the description just enter "Capri Update Script" and click "Deploy" in the bottom right.

After it's deployed, click the clock icon on the left labelled "triggers" and then add a new trigger in the bottom right.

On the page that pops up, make sure that the "Choose which function to run" option is set to "sendHttpRequest" and that the "Select Event Type" option is set to "On edit".

Afterward, save this trigger, and you should be good to go!

Last updated