What Is The Off With Their Heads Technique?

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

What Is The Off With Their Heads Technique?

Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,904 Points 20k badge 2x thumb

Posted 3 years ago

  • 0
  • 1
Photo of justin_vuong

justin_vuong

  • 0 Points
I did a google search, but couldn't find anything. I'm curious myself. 

-Justin
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,904 Points 20k badge 2x thumb
You got to give me time to answer my own question.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,904 Points 20k badge 2x thumb
What a coincidence you ask as I have been using this technique all week with great results! In a nutshell, the Off With Their Heads technique is a way to run QuickBase (or any website) without a visual browser in what is called a headless browser. Why on earth would you want to do that you may ask. Suffice it to say there are a lot of things you can automate in a headless browser that would be difficult to accomplish manually working the graphical interface. For example, let's say you wanted to do something silly like turn off application tokens for every application in your account (don't do this as you weaken security). This is easy to accomplish in a headless browser such as PhantomJS used along with an automation library like CasperJS. Here are the details on these two items:

PhantomJS
http://phantomjs.org/


CasperJS
http://casperjs.org/


More practically, perhaps your organization has a need to document all of your QuickBase assets such as your forms, reports, users, etc. You could do this manually by navigating each application, extracting information and screenshots from each application or table and manually assembling the result into some type of report or data dictionary. Good luck with that - you will probably only attempt this once and never repeat the process because it is too difficult to repeat and error prone. However, it is pretty straightforward to use PhantomJS and CasperJS to automate this data collection process and to faithfully repeat it on demand with the click of a button or on a schedule. 

There are probably a lot of other workflow, administrative or maintenance tasks that can be automated using the Off With Their Heads technique. I would be curious to hear what you what type of automating task you are currently missing with QuickBase. I don't have any code to post in this post but I will posts a demo once I come up with a common problem that needs to be solved. Feel free to contact me off world if you want to discuss this technique.

BTW, this technique can be used with any web site including this forum. I think I am going to write some short scripts to automate some of my answers in this forum.

https://www.youtube.com/watch?v=Eobuu-IexvI
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,904 Points 20k badge 2x thumb
I created a simple but practical example of logging into Quickbase and printed a report to pdf automatically. The CasperJS script in the pastie below uses the prints the following report (see attached pdf file)

Formula Functions Reference
https://www.quickbase.com/db/6ewwzuuj?a=q&qid=-3228375&dlta=pr~fl6.7.11.8.9.10.12.13.~ And is invoked using this command:

DOS> casperjs test3.js

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=502


Notes:

(1) You don't need to login to QuickBase to view this public report but I left the login protion of the script in place as you would probably be using this script to print your own private reports.

(2) The script uses casper.waitUntilVisible("#qbDialogPrint", ...) to detect that the popup dialog is visible before clicking the on confirm button within a subsequent step using this.click("#qbDialogPrint button.Confirm");

(3) you of course can modify print options and print multiple documents by just adding additional processing steps to the CasperJS script.

Just for drill and to become proficient using CasperJS I will be writing a couple of scripts a day for the next month or so to automate both QuickBase and non-QuickBase tasks. If you have ideas for tasks that might need automation in QuickBase feel free to let me know here or off world using the contact information in my profile.
Photo of B

B

  • 20 Points
WOW! Dan, I love your posts on this site.  Are you going to be at Empower 16?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,904 Points 20k badge 2x thumb
Yes I will be there and I am bringing a boat full of new gimmicks including my voice controlled QuickBase demo.
Photo of justin_vuong

justin_vuong

  • 0 Points
That sounds cool!
Photo of B

B

  • 20 Points
Voice control, wha!  Hmm, what is in that tool-belt of yours, Annyang? pocketsphinx? Web Speech API? or has someone been playing around with Jasper?  

I can't wait to see what the boat's bringing.  I would like to meet you while your there, maybe grab a beer and get your autograph.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,904 Points 20k badge 2x thumb
AnnYang - it is incredibly simple. It came up in a project unrelated to QuickBase and it worked out wonderfully. The real trick with using it with QuickBase was to embed the QuickBase dashbaord in a iframe in a user defined page and then use history.replaceState to manipulate the URL so it looks the the dashboard URL (not the user defined page URL). This way you can create a control/observer in the user defined page that can fully control and observe what goes on in the iframe. So you put your AnnYang code in the user defined page and when a voice command is recognized you manipulate the iframe accordingly. The URL in the address bar appears to never change!