Skip navigation

Developer Community

6 Posts authored by: Jason McKee Employee

It’s that time of year again!  Time to submit proposals for breakouts and workshops for the next CreatorCon.  We’re making CreatorCon bigger and better this year by running for three days in parallel with Knowledge.  Which means there’s even more chances for you to share all the cool stuff you’re doing on the ServiceNow platform with your fellow developers and architects.


Have you built a cool integration or built an app that solved a problem in a unique and different way?  How about a super-engaging user experience with Service Portal?  Do you have an architectural model that works really well for when to use ServiceNow as a system of record vs system of engagement or to orchestrate complex processes across people and systems?  Come demo how you made it happen for your peers.  Want to take your sharing to the next level?  Design a hands-on workshop so your fellow developers can not only see how you built your solution, but get to experience building it themselves.


If your session is selected, you’ll get a complimentary pass to Knowledge and CreatorCon.  Submit your proposals here by Dec 5th

Jason McKee

Introducing LiquorBot

Posted by Jason McKee Employee Sep 16, 2015

Knowledge is always an awesome opportunity to see what other people are doing with the platform and get inspired for things you can do.  For me, Knowledge 15 and CreatorCon were no different.  Fruition brought FruBot, which would drive up and serve you a beer, initiated by service catalog request.  And Joshua Bray put together an awesome lab for the Creator Con Hack Zone that interfaced ServiceNow with an Arduino to perform alerts and actions.


Looking at those two projects, I started thinking about how I could take those concepts and take them further. Since I was in Vegas and the iPad driven drink menus were everywhere, the answer hit me: make a ServiceNow powered bartender robot to mix drinks!


After learning how to develop on the Arduino (prior to Josh’s HackZone lab, I had never played with an Arduino before) and a bunch of cutting, drilling, grinding, welding, plumbing and painting, I had a Wi-Fi-enabled bartender robot with a very basic REST API that take a simple list of how many ounces to dispense from each of it’s 8 bottles.


LiquorBot at Santa Clara.jpeg


The vast majority of what makes LiquorBot tick is all built in ServiceNow.  There is a database of over 10,000 drink recipes (loaded from a terrible, terrible comma and pipe separated flat file full of bad formatting and errors, but that’s a story for another day), and 1700 potential ingredients.  There’s a Script Include to parse and validate recipe text like “1 ½ oz fresh orange juice” into discrete “1.5”/”oz”/”orange juice” fields as well as convert different units of measure into ounces.  For example, it turns out that a “dash” and “splash” actually have precise volumetric definitions (0.03125oz and 0.125oz in case you were wondering).  And another Script Include for making calls to LiquorBot’s API using RESTMessageV2.


On the bot side of things, the pumps are fairly consistent in terms of X number of seconds of run-time moves Y volume of liquid (1990ms per oz for those of you wondering).  When the API receives “bottle 1 gets 0.33 oz”, that translates to “turn on the relay for bottle 1 for 657ms”.  I wasn’t sure how accurate the pumps would actually be until I got the bot all put together and started testing, but I was pleasantly surprised to find that it could indeed accurately dispense a single dash of Vermouth (I like my martinis very dry).  After all the ingredients have been dispensed, a pump flushes the output plumbing with air to clear the output tubing so no ones tequila sunrise gets mixed up with the last person’s whiskey sour.



To setup LiquorBot to start pouring drinks, you put the feed tubes from the pumps into the bottles of alcohol and mixers and load them into LiquorBot.  You then configure select the ingredients in the ServiceNow interface and set the dispenser number for each ingredient.  In the background, changing the dispenser field on an ingredient fires a series of events causing every recipe with that ingredient to be checked to see if it has all of it’s ingredients available on a dispense or not and updates it’s “mixable” flag.  In addition to checking for exact ingredients, the “mixability validation” logic also takes into consideration substitutions, so if you tell LiquorBot that you have “vodka” on bottle #1, it will pull in recipes that call for Kettle One and Gray Goose vodka as well.


Screen Shot 2015-09-15 at 7.18.38 PM.JPG


Today interaction with LiquorBot is via UI Actions on the List and Form views.  There are actions to prime the pumps (pulling just enough liquid in to fill the feed tubes) and run a clean cycle to flush the system with water.  The most important UI Action is Vend.  You may browse/search recipes using a List view (want a non-alcoholic drink? Filter on the category field) or pull up the Form view to see the ingredients that go into the drink.  When you’ve made your selection, click the Vend action under Related Links (or right-click in the list view to select Vend) and your selected recipe will be converted to ounces, packaged up into a RESTMessage and sent to LiquorBot’s API via a MID Server.  Within a few seconds LiquorBot will have pumped the perfect amounts into your glass and your drink is ready to enjoy.



LiquorBot recently had its first outing at our Santa Clara headquarters and is also being demo-ed at our Custom Application Development Workshops in Houston and Dallas this week.  What’s next for LiquorBot?  Adding a Service Catalog interface, reporting on drinks that were served, inventory control, like any good project the list of fun things to do never ends.  Interested in seeing what makes LiquorBot tick?  There's lots of moving parts between the ServiceNow code and Arduino code, not to mention that actual building of the bot itself (for example, lesson learned: 1/8" wall steel tubing may be what's laying around the garage, but is massive overkill.  LiquorBot tips the scales at a touch over 30lbs without any bottles loaded).  Let me know what's interesting in the comments below and I'll make sure to cover it in a "making of" post.



We're doing a bunch of Custom App Dev workshops this week in Altanta, San Diego, Houston and Dallas.  If you're signed up for one of these workshops, the files you need are attached to this post.  If you're interested in what events may be happening near you, be sure to check our events calendar.


And if you're not signed up for a workshop this week, good news!  The workshop guidebook is attached as well and you can grab a free instance from the developer portal and work through the material at your leisure.

Boosting the signal here.


poornachander wrote up a nice blog post on the different integration APIs available on the platform: ServiceNow Integration API Technology Stack


The only note I'd like to add is that if you're starting off something new, use the new REST API instead of JSONv2.  The new REST API is faster and more consistent with what one would generally expect from a REST interface.  And it works with the REST API Explorer tool too.  JSONv2 isn't going away, but going forward the emphasis will be on the REST API.

Want to try your hand at melding ServiceNow with home brew electronics?  Joshua Bray has put together an awesome lab for the CreatorCon Hack Zone that lets you connect your ServiceNow instance to bare-metal wires, switches and LEDs using an Arduino microcontroller (the same device that powers Fruition's beer bot).


You can get a jump start by looking at Josh's Hack Zone lab instructions and downloading the Arduino IDE and node.js.


Here's Josh demonstrating an early prototype for the lab:


And here's the hardware in action as you'll find in the Hack Zone.


The Developer Lounge at CreatorCon this year will be featuring a Hack Zone where you can get hands-on experience integrating ServiceNow with Internet of Things devices such as Phillips Hue color LED lightbulbs, Belkin WeMo switches and motion sensors and even Arduino micro-controllers.  We’ll provide IoT devices, integration code and sample apps, you provide great ideas!


To whet your appetite, the Phillips Hue lab is up on Share.  Using a Hue hub and a MID server, you can query and set light colors, modify lighting groups and anything else supported by the Hue API.  Want to flash the lights red when you’re about to break an SLA or turn them green when your project is on schedule?  Now you can!


Be sure to come by the Hack Zone, show off your app and play with the other IoT toys.

Filter Blog

By date: By tag: