What Are QuickBase Snippets?

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

I keep hearing everyone raving about QuickBase Snippets. What are they and what can you do with them?

Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,924 Points 20k badge 2x thumb

Posted 4 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,924 Points 20k badge 2x thumb
I could be wrong but I think what you are referring to is Chorme Snippets which of course can be used to advantage developing features and enhancements for QuickBase as well as automating various administrative tasks with script that is saved within the Chrome browser itself. 

It may surprise even some advanced users but script development for QuickBase should not done through uploading user defined pages and then testing the script's performance within QuickBase. The reason you should not take this approach is because the process is way too slow. You will repeatedly have to manually cut and paste code into the <textarea> of the user defined page interface unless you take another approach. It is much faster to use the JavaScript Console within the web browser's Developer Tools to develop your script.

All major browser's support a Developer Tools feature which while different from on another can all be accessed by hitting the F12 key. Once your script is working correctly after being debugging in with the JavaScript Console you can place the code into a user defined page and do your final integration testing. Now Snippets is just an additional enhancement to the Chrome Developer Tools that allows you to store fragments of reusable code in Chrome and run them from within the Developer Tools interface on demand.

Let me show you how to setup Snippets in Chrome and provide you an example Snippet I use frequently.

Procedure Install To Install Chrome Snippets

(1) With Chrome visit chrome:flags

    chrome://flags/#enable-devtools-experiments

(2) Click on Enable

(3) F12 to open Developer Tools

(4) Select the "Sources" tab then select the "Snippets" tab

(5) right click in Snippets panel and select New

(6) rename newly created Snippets

(7) Enter JavaScript code in Code Panel

(8) Right click in Code panel and select Save

(9) Right click on the Snippet you want to execute in Snippets Panel and select Run

Yes it is a bit of a complicated procedure but it is well worth enabling because of the productivity gains it will give you.

Example Snippet

Prior to posting a screenshot to the forum I have to frequently remove  some of the tabs QuickBase inserts into the blue bar tab used to navigate to recently used applications. I have to do this to not reveal tabs that might display application names for client work or other top secret projects. But on the other hand I sometimes create fake application names and arrange for them to show up on the blue bar tab as part of an elaborate subliminal mind control experiment (like in the screenshots attached). In any event I use a short script to remove the inactive tabs:

$("#navTopAppBar li").not(".ui-tabs-selected").each(function() {
  $(this).find("a.CloseTab").trigger("click");
});

The attached screenshots shows the above Snippet named QB: Close Inactive Tabs being saved and run within Chrome Development Tools.

While you could copy and paste this code into JavaScript Console manually it is easier to just place the code into a Chrome Snippet and run it with a simple mouse selection.

Finally, you probably will not find this particular Snippet all that useful but any script that you want to run against QuickBase can be saved and used on demand by storing it in a Snippet. so you can automate just about any task sequence you can define.