Chicken Tracking with QB
Here's my latest cause for Quick Base celebration: A while back I made a Quick Base app for tracking my flock of chickens and supply inventory, but just incorporated RFID scanning to help move toward automatically tracking egg production instead of manually tapping URL formula buttons. Very much still a work in progress, but here's what it does so far and how it works: The app keeps records of what chickens are in the flock, egg production, store health records, supply purchasing/use, and a journal to write entries about any or all of the chickens. One night I was browsing my favorite overseas merchant website and came across these leg bands for fowl that contain an RFID chip. They were about $.27 a piece, so I bought a bunch, and a cheap USB RFID reader too. I created a table of all of the RFID tags, and a table for scanner entries, and linked each chicken to an RFID number, so that when one was scanned the entries table would "know" who the chicken was. Then I needed the scanner to be in a stationary place ready to scan anytime, so I wrote a little Python script that sits and waits for a scan, and when it detects one creates a record in the entries table using the Quick Base API. I decided to put the scanner in the nest box to find out who was laying eggs and when. It's also a confined space where I thought I'd have the most luck with the RFID system, which is the low-frequency passive type (chosen because they're cheap and don't require batteries or charging. The trade off, however, is that they only get scanned when they are close enough to receive power from the scanner). After hiding the scanner under some straw on the side of the nest near where the banded leg would be, the Raspberry Pi was put outside of the nest on a nearby shelf. With everything set up, connected to the network and seemingly working, it was time to put the bands on the chickens: Over the next few days of anxiously awaiting email notifications of scans, I finally got about 40 one morning over the course of about 45 minutes, all from the same chicken. I've had some luck so far, but have been looking into a more powerful scanner that would ensure scans without the RFID chip needing to be so close to the scanner. (Since putting in the scanner I've also found a couple of bushes the chickens have been laying eggs under since they have the run of the yard in summer, but with winter coming they should be laying more inside). I'd also like to add more scanners in various locations, but that may depend on what can be done to find a scanner that could read at a longer distance. I also need to find a better way to display some of this data, especially if its coming from multiple scanners. I'm thinking a summary type table that would group by location and calculate duration to show how long a chicken was in a given spot over the course of a day. A way to detect if an egg is actually laid, and automatically log that in the egg table for the correct chicken is also a future addition once the best way to do that is figured out. Ultimately, it'd be cool to have scanners that could also track various spots to get an idea of how they spend their days, and know when they're all inside for the evening and automatically close the coop door for the night. If anyone has any ideas about any of this, or experience working with RFID or Raspberry Pis and Quick Base, I'd love to hear about it! ------------------------------ steve. ------------------------------84Views11likes13Comments- 61Views7likes28Comments
Command Line Interface for Quickbase
Quickbase is a no-code platform that problem-solvers use to build powerful business applications regardless of their technical ability, but that doesn't mean software developers can't have fun, too! For example, Quickbase has robust and powerful APIs that enable coders to extend and automate Quickbase. In fact, API requests make up a higher percentage of traffic to Quickbase than one might think. In that spirit, I want to introduce you to the Command Line Interface for Quickbase, which makes it even easier to interact with and automate Quickbase through its APIs. https://github.com/QuickBase/quickbase-cli Graphical interfaces like web browsers make it possible for a wide range of people to use software and simplify tasks. With that said, how many times has your index finger felt like it was going to fall off while fighting sleep as you repeatedly perform some monotonous task in Quickbase through the browser? It's situations like this where the command line can save you hours, not to mention your sanity. You can find examples of how to use the tool in the repository's README. Hopefully, it inspires ideas on how you might use it to save time automating your Quickbase tasks. The CLI tool is one of many capabilities in the Quickbase platform that help you automate repetitive tasks. Here are some guidelines to help point you towards the best tool for your task: Use Pipelines and consume the API directly if you are automating a task in response to an action that happens in Quickbase or another system. Consume the API directly with the language of your choice when building a non-Quickbase application that connects to your Quickbase app. Use the Quickbase CLI to perform app setup/admin tasks and ad-hoc calls to the API. Finally, the Quickbase CLI is released as an open source project, which means you can submit enhancements, bug fixes, and documentation through GitHub pull requests if you can write code. Installation instructions, examples, and tips are provided in the README. The tool is subject to the permissive MIT license, so you can freely use it as you see fit inclusive of use in proprietary applications, provided that you maintain the copyright and license with the code. The license also states that the code is provided as-is without warranty, so unlike the Quickbase platform, the tool is not subject to assistance through Quickbase support entitlements. However, contact with the authors is only a GitHub issue away, so please post and feedback, bugs, and questions through the repository's normal GitHub channels as per the guidelines. Happy building! ------------------------------ Chris Pliakas ------------------------------12Views4likes0CommentsConnecting Quickbase to AWS for Sentiment Analysis
Quickbase is uniquely positioned to solve numerous business problems because of both the product's incredible flexibility and the different approach to how people build applications on the platform. The problem solvers who use the tool can resolve critical business challenges themselves in days and even hours on a system that IT trusts and can govern at enterprise-scale. Although powerful in business users' hands, the technically inclined can elevate Quickbase to new heights by integrating it with other systems through extension points such as Pipelines, Quickbase's native integration platform. Public cloud providers like Amazon Web Services provide many building block services that go together with Quickbase like peanut butter and jelly, and I want to introduce a sentiment analysis capability for Quickbase using Pipelines and AWS as a working example of this power. The Amazon piece is available at https://github.com/cpliakas/quickbase-sentiment-analysis, and developers can replicate the pattern for other AWS services as well. As context, Quickbase applications often capture data at the edge of the business. The more data that is captured, the more important it is to automate data analysis to extract insights from it. For example, let's say you want to crowd-source inspection of inventory, products, etc. The goal is for employees to snap pictures and submit comments when they happen to notice something in the field, such as an example of a great product display or a misplaced item. Within minutes, you can create a Quickbase application that is mobile-ready and able to be used in the field. A welcomed problem is when the application becomes widely used across the organization, and manual analysis of the data becomes impractical. One way to start categorizing the data is through sentiment analysis of the comments to sort the feedback into positive, negative, and neutral submissions to determine which ones to act on first. This situation is where our example comes into play. Amazon has a service called Comprehend that provides sentiment analysis. At first glance, the integration appears to be dead-simple. However, many hidden complexities around authentication and infrastructure configuration take time to figure out. The project at https://github.com/cpliakas/quickbase-sentiment-analysis provides a one-click install of the Amazon piece of the puzzle through theServerless Application Repository that has Quickbase assumptions which make it really easy to securely integrate with Quickbase through Pipelines. The video below walks through an end-to-end setup so that you can start experimenting with the capability now. The https://github.com/cpliakas/quickbase-sentiment-analysis project is released under the permissive open-source MIT license. You are free to use and copy the tool and apply the patterns in whatever manner you wish, including commercial applications where people pay for your service. I hope you find it useful, and I look forward to learning about where the tool and techniques are providing value to your Quickbase applications. ------------------------------ Chris Pliakas ------------------------------7Views1like0CommentsQuickBase Reaches Escape Velocity
QuickBase Reaches Escape Velocity I would like to show you a new demo that highlights an amazing new way of introducing script into QuickBase using Rich Text Formula Fields that is (1) self-contained, (2) extremely flexible and (3) simple to use. This demo builds on other recent forum postings and demos but provides a clever way to get around a few technical limitations the current QuickBase platform has. QuickBase could easily correct these limitations in a future version of the product but I will show you how you can apply the technique today. It is great that this demo lands just before the start of the year as I can honestly say QuickBase's capabilities using this and related techniques are going to explode and leave the bounds of this planet in 2019. For the demo I will show you how to implement the Haversine function - yes the same name that my business is named after. You probably never studied the Haversine function in High School trigonometry class but it is used today to calculate distance between two points on a sphere (eg your planet Earth) and has the following definition. Here is the Haversine function definition: Clearly this function can't be implemented in the QuickBase formula language because there are no trigonometric functions. It can of course be implement in JavaScript and I will demonstrate how as well as indicate how any JavaScript function can be integrated into the QuickBase formula language. I have implemented the Haversine functionin aES6 Module saved in a code page: function haversine(x) { return (Math.sin(x/2))**2; } export {haversine}; Haversine.js Code Page https://haversineconsulting.quickbase.com/db/bn9494bih?a=dbpage&pagename=haversine.js Now this ES6 Module is short and exports only one function but one point of this demo is to show you how an arbitrary long module exporting multiple functions or objects could be saved in a Code Page and used within a specially crafted Rich Text Formula Field. Now here is the actual Rich Text Formula Field definition written using the new 3Q&S Technique: "<img src" & " data-x='" & & "'" & " onerror=' (async () => { const {haversine} = await importCodePage('bn9tk69aj', 'haversine.js'); let x = this.dataset.x; let hx = haversine(x); this.outerHTML = hx; //helper function - don't change the code below: async function importCodePage(dbid, codepage) { const moduleCode = await fetch('${dbid}?a=dbpage&pagename=${codepage}').then(r => r.text()); const moduleSpecifier = 'data:application/javascript,${encodeURIComponent(moduleCode)}'; return import(await moduleSpecifier); } })(); '>" Note everything in this formula is boilerplate except the five lines of code that are highlighted in bold! QuickBase could easily modify their formula editor to enter just the five lines of functional code and supply the remaining boilerplate through some back-end process you would never need to see the details of. Here is the demo: Haversine Function ~ ImportCodePage ~ Records List All https://haversineconsulting.quickbase.com/db/bn94954a4?a=q&qid=1 You can of course create you own record and verify the Haversine formula calculation using Wolfram Alpha: Here is the [Haversine(x)] field displayed in the formula editor: Pastie Database https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=715 Notes: (1) I was stumped for a while while developing this code because I wrote the word ?don't? in a comment and didn't realize that it contained a single quote character. Once I replaced it with a backtick quote?don't?everything worked as designed. (2) This demo gets around the fact that code pages containing JavaScript are not served with the correct MIME Type from QuickBase. This is the third method that has been presented to solve the problem and probably is going to be the best method as you don't need to host the ES6 Module from a separate server or employ a Service Worker to correct the MIME Type. (3) The trick to get this to work is to import a dynamically generated module specifier expressed as a dataURL. The correct MIME Type is introduced through the prefix at the head of the dataURL: const moduleSpecifier = 'data:application/javascript,${encodeURIComponent(moduleCode)}'; (4) The technique demonstrated in this demo is extremely powerful. There is no limit to what this technique can do as you can import any ES6 Modules you wish (from an externalCDN or QuickBase Code Page) and use arbitrary JavaScript within the Rich Text Formula Field to perform calculations on field values or change the page's behavior.2Views1like2CommentsExample of SaveBeforeNavigating
Just came by to say it's verking! I am filled with so many happy's. "Builders can now use a new CSS class ( SaveBeforeNavigating ) inside of a formula-rich text field so that Quickbase saves the record before navigating when this setting is used. Note that only one of the above workflow classes is supported per formula-rich text." Example code of a button: var text btnName = If(Contains([Egnyte_Link_Text],""),"", If([Email Payroll Trigger],"Email Sent","Send Dispatch to Payroll")); //URL var text urlOne = If(Contains([Egnyte_Link_Text],""),"",If([Email Payroll Trigger], URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & URLEncode ([Record ID#]) & "&apptoken=&_fid_369=0&_fid_370=\"\"" & "&z=" & Rurl(), URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & URLEncode ([Record ID#]) & "&apptoken=&_fid_369=1&_fid_370=" & Today() & "&z=" & Rurl())); var text urlTwo = URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & URLEncode([Record ID#]); var text url = $urlOne & "&rdr=" & URLEncode($urlTwo); //Style var text style = If(Contains([Egnyte_Link_Text],""),[styleGrey], If([Email Payroll Trigger], [styleGrey],[styleEdit])); //Target var bool popup = false; var text target = If($popup = true, "target = _Blank ", ""); var text title = "Click button to send Dispatch to Payroll"; //*****DO NOT EDIT BELOW THIS LINE***** //HTML "<a class='SaveBeforeNavigating' title=\"" & $title & "\"style =\"" & $style & "\"" & $target & "href=" & $url & ">" & $btnName & "</a>" //Syntax end ------------------------------ Jim Harrison transparency = knowledge + understanding : The Scrum Dudes ------------------------------22Views1like0CommentsService Worker
I am working on implementing changes with Service Workers. I am following the series of posts from Dan Diebolt, Service Worker Travel Logs, and it is making sense. The one part I am stuck on is in the last one;https://community.quickbase.com/quickbase/topics/service-worker-travel-log-day-13, specifically implementing the cheerio.js library. Do I need to bring over every file in the GitHub page, or is there a way to simply reference them all at once?17Views1like7Comments