Inspired by octopart.com/excel add-in, this add-on offer Google Docs integration for Octopart.
This add-on was officially available at the Google Docs Add-on Store here, but it is currently blocked due to lacking OAuth verification (see this and this issue). That being said, it still works (as of October 2021) and it isn't hard to install manually using the files available here and the following steps:
- From Google Sheets, select the Tools menu > Script Editor. It will open an untitled project. Rename it to "Octopart Google App" (or whatever you want).
- When the script editor creates a new project, it also creates the file Code.gs by default. Rename it to
functions
to match the first *.gs file in this project (the .gs extension will be added automatically, so don't type it). From the code view of this project click on functions.gs then on the button to "Copy raw contents". Paste those contents into the script editor. - In the script editor add a new script file named
octopart
and copy the raw contents of octopart.gs from GitHub into it. - Repeat for ui.gs.
- Add sidebar.html in a similar way, but tell the script editor it is an HTML file rather than a script file.
- Press CTRL-S to tell the script editor to save the project.
- If you don't already have one, create an account at Octopart.com using your email address.
- Somewhere in your Google Sheet (another tab is OK), set the user by entering this in a cell (using your email address)
=OCTOPART_SET_USER("[email protected]")
. Note that you need quotes around your email address. It make take a little time, but eventually that cell should show "Octopart Add-In is ready". - Try to look up some information. For example, enter the following in some cells (these are just an example) of your Google Sheet:
- In cell A10:
LIS2DW12TR
- In cell B10:
STMicroelectronics
- In cell C10:
=OCTOPART_DETAIL_URL(A10, B10)
- In cell A10:
- It should look up the Octopart URL for that part and display it, like this: https://octopart.com/lis2dw12tr-stmicroelectronics-77080925
- In D10 try
=OCTOPART_DESCRIPTION(A10, B10)
- In E10 try
=OCTOPART_DISTRIBUTOR_STOCK(A10, B10,"Digi-Key")
- In F10 try
=OCTOPART_DISTRIBUTOR_STOCK(A10, B10)
- If it can't find the part, it displays "No offer found". That is normally OK, but it causes problem if you are trying to find the sum of the parts at multiple distributors and one of them doesn't stock that part. That can be dealt with like this (for Digi-Key and Mouser):
=if(isnumber(OCTOPART_DISTRIBUTOR_STOCK(A10, B10,"Digi-Key")),OCTOPART_DISTRIBUTOR_STOCK(A10, B10,"Digi-Key"),0)+if(isnumber(OCTOPART_DISTRIBUTOR_STOCK(A10, B10,"Mouser")),OCTOPART_DISTRIBUTOR_STOCK(A10, B10,"Mouser"),0)
.
- If it can't find the part, it displays "No offer found". That is normally OK, but it causes problem if you are trying to find the sum of the parts at multiple distributors and one of them doesn't stock that part. That can be dealt with like this (for Digi-Key and Mouser):
Documentation was available here, but the link is now broken.
The video here does a nice job of demonstrating how it works.
Just type =OCTOPART
and see what pops up. It may not show every option, so keep typing if you want to see more, e.g. =OCTOPART_DIST
.
There are pull requests here with additional functions. If you know Javascript (or any C-like language) you can probably figure out how to make more following those and the original examples.