BioTrash.THC (New Mexico)

$0.00

What is this?

This is a Spreadsheet template with codes needed to connect to BioTrack, that can connect to BioTrack. it can pull (read) data, specifically vendors, current inventory, rooms, manifest; with details, QA information including samples that are sent out, and can call tested samples into the  inventory table. 

It can be used for reporting, warehouse management, production forecasting etc, it can be as big or small as you need it to be. 

Resources

How it Works

The process of connecting your Google Sheet to the BioTrack server relies on a series of custom Google Apps Scripts that manage authentication and data requests.

How the Connection Works:

  1. Credential Storage: You start by entering your BioTrack Username, Password, and License number into the "Settings" tab of your Google Sheet. The Utilities.gs script reads these values when a connection is initiated.

  2. Authentication: When you click "Connect to BioTrack" from the custom "BioTrash.THC" dropdown menu, the Auth.gs script is triggered. This script packages your credentials into a JSON payload and sends a POST request directly to the BioTrack API.

  3. Session Management: If the credentials are valid, the BioTrack server responds with a unique Session ID. The script saves this Session ID, along with the login time, back into your Settings sheet.

  4. Ongoing Communication: For all subsequent actions (like pulling inventory or manifests), the BioTrack.gs script acts as the messenger. It takes your requested action, automatically attaches your saved Session ID to prove you are authenticated, and fetches the requested JSON data from the server.

How do I set up the API credentials?

To set up your API credentials, you need to input them directly into the designated tab within your Google Sheet:

  • Open the Settings tab in your Google Sheet.

  • Input your credentials using a key-value format in the first two columns. Specifically, you need to provide your Username, Password, and License (your license number).

How it works behind the scenes: The Utilities.gs script is designed to read these specific credential keys from the Settings sheet. When you initiate a login, the Auth.gs script retrieves your Username, Password, and License number and securely sends them to the BioTrack API. Upon a successful login, the script will automatically record your active SessionID, Session Time, and Last Login timestamp back into the Settings sheet so they can be used for your subsequent data syncs.

How do I trigger the initial login?

You can trigger the initial login directly from your Google Sheet using the custom menu interface.

  • Look at the top menu bar of your spreadsheet for a dropdown menu named "BioTrash.THC".

  • Click the menu and select "Connect to BioTrack".

This custom menu is generated by the Menu.gs script. When you click "Connect to BioTrack", the script uses the credentials you set up in your Settings tab to communicate with the BioTrack API, authenticate your account, and save your active Session ID so you can begin syncing your inventory and other data.

How do I sync my inventory after logging in?

To sync your inventory after logging in, you can use the same custom menu you used for the initial connection:

  • Click the "BioTrash.THC" dropdown menu at the top of your Google Sheet.

  • Select "Sync Inventory".

When you click this, the script contacts the BioTrack API to pull your latest inventory records. It will automatically clear out the old values in your "Inventory" sheet and rewrite it with the fresh data, cross-referencing your "Inventory_Type" and "Rooms" sheets to translate numerical IDs into readable names.

If you prefer not to do this manually every time, you can also set up Google Apps Script triggers to run these syncs automatically throughout the day. This creates a semi-live connection, allowing you to see updated inventory availability as your team makes changes in BioTrack.

How do I set up automatic sync triggers?

The provided sources mention that using Apps Script, syncs can be triggered to run throughout the day. This creates a "semi-live" system, allowing you to automatically pull updated inventory data as your team makes changes in BioTrack.

While the sources show a screenshot of the Apps Script dashboard featuring the "Triggers" icon (an alarm clock), they do not provide the exact step-by-step instructions for configuring them.

Please note: The following step-by-step instructions are standard Google Apps Script procedures and come from outside of your provided sources.

To set up an automatic time-driven trigger:

  1. Open the Apps Script editor from your Google Sheet (Extensions > Apps Script).

  2. On the left-hand navigation menu, click the Triggers icon (it looks like an alarm clock).

  3. Click the + Add Trigger button in the bottom right corner.

  4. Choose which function to run: Select the script you want to automate from the dropdown (for example, syncInventory).

  5. Select event source: Change this to Time-driven.

  6. Select type of time based trigger: Choose the frequency you want (e.g., "Minutes timer" or "Hour timer").

  7. Select interval: Pick how often it should run (e.g., "Every 15 minutes" or "Every hour").

  8. Click Save. (You may be prompted to authorize the script again during this step).

You can repeat this process for any other functions you want to automate, such as syncing manifests or vendors.

Why is this free?

Because everyone else is already trying to nickle and dime you, if you find this useful just let people know where you found it please.

What is this?

This is a Spreadsheet template with codes needed to connect to BioTrack, that can connect to BioTrack. it can pull (read) data, specifically vendors, current inventory, rooms, manifest; with details, QA information including samples that are sent out, and can call tested samples into the  inventory table. 

It can be used for reporting, warehouse management, production forecasting etc, it can be as big or small as you need it to be. 

Resources

How it Works

The process of connecting your Google Sheet to the BioTrack server relies on a series of custom Google Apps Scripts that manage authentication and data requests.

How the Connection Works:

  1. Credential Storage: You start by entering your BioTrack Username, Password, and License number into the "Settings" tab of your Google Sheet. The Utilities.gs script reads these values when a connection is initiated.

  2. Authentication: When you click "Connect to BioTrack" from the custom "BioTrash.THC" dropdown menu, the Auth.gs script is triggered. This script packages your credentials into a JSON payload and sends a POST request directly to the BioTrack API.

  3. Session Management: If the credentials are valid, the BioTrack server responds with a unique Session ID. The script saves this Session ID, along with the login time, back into your Settings sheet.

  4. Ongoing Communication: For all subsequent actions (like pulling inventory or manifests), the BioTrack.gs script acts as the messenger. It takes your requested action, automatically attaches your saved Session ID to prove you are authenticated, and fetches the requested JSON data from the server.

How do I set up the API credentials?

To set up your API credentials, you need to input them directly into the designated tab within your Google Sheet:

  • Open the Settings tab in your Google Sheet.

  • Input your credentials using a key-value format in the first two columns. Specifically, you need to provide your Username, Password, and License (your license number).

How it works behind the scenes: The Utilities.gs script is designed to read these specific credential keys from the Settings sheet. When you initiate a login, the Auth.gs script retrieves your Username, Password, and License number and securely sends them to the BioTrack API. Upon a successful login, the script will automatically record your active SessionID, Session Time, and Last Login timestamp back into the Settings sheet so they can be used for your subsequent data syncs.

How do I trigger the initial login?

You can trigger the initial login directly from your Google Sheet using the custom menu interface.

  • Look at the top menu bar of your spreadsheet for a dropdown menu named "BioTrash.THC".

  • Click the menu and select "Connect to BioTrack".

This custom menu is generated by the Menu.gs script. When you click "Connect to BioTrack", the script uses the credentials you set up in your Settings tab to communicate with the BioTrack API, authenticate your account, and save your active Session ID so you can begin syncing your inventory and other data.

How do I sync my inventory after logging in?

To sync your inventory after logging in, you can use the same custom menu you used for the initial connection:

  • Click the "BioTrash.THC" dropdown menu at the top of your Google Sheet.

  • Select "Sync Inventory".

When you click this, the script contacts the BioTrack API to pull your latest inventory records. It will automatically clear out the old values in your "Inventory" sheet and rewrite it with the fresh data, cross-referencing your "Inventory_Type" and "Rooms" sheets to translate numerical IDs into readable names.

If you prefer not to do this manually every time, you can also set up Google Apps Script triggers to run these syncs automatically throughout the day. This creates a semi-live connection, allowing you to see updated inventory availability as your team makes changes in BioTrack.

How do I set up automatic sync triggers?

The provided sources mention that using Apps Script, syncs can be triggered to run throughout the day. This creates a "semi-live" system, allowing you to automatically pull updated inventory data as your team makes changes in BioTrack.

While the sources show a screenshot of the Apps Script dashboard featuring the "Triggers" icon (an alarm clock), they do not provide the exact step-by-step instructions for configuring them.

Please note: The following step-by-step instructions are standard Google Apps Script procedures and come from outside of your provided sources.

To set up an automatic time-driven trigger:

  1. Open the Apps Script editor from your Google Sheet (Extensions > Apps Script).

  2. On the left-hand navigation menu, click the Triggers icon (it looks like an alarm clock).

  3. Click the + Add Trigger button in the bottom right corner.

  4. Choose which function to run: Select the script you want to automate from the dropdown (for example, syncInventory).

  5. Select event source: Change this to Time-driven.

  6. Select type of time based trigger: Choose the frequency you want (e.g., "Minutes timer" or "Hour timer").

  7. Select interval: Pick how often it should run (e.g., "Every 15 minutes" or "Every hour").

  8. Click Save. (You may be prompted to authorize the script again during this step).

You can repeat this process for any other functions you want to automate, such as syncing manifests or vendors.

Why is this free?

Because everyone else is already trying to nickle and dime you, if you find this useful just let people know where you found it please.