What is the "Play the Field" Technique?

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

I got to tell you organizing the Mas Que Nada (Portuguese for No Way) User Group Conference in Brazil was one of the greatest ideas I have ever dreamed up with in conjunction QuickBase. Sure it has been difficult working over 5,000 miles away from the fake venue in a language you don't even speak. And there have been disappointments along the way including not securing the Rolling Stones as entertainment over a shortage of parking at the venue and then having to reschedule everything when we learned Brenden Eich (the creator of JavaScript) was headlining at the Brazil JavaScript Conference the same week as Mas Que Nada. But on the other hand Brazil is a vast emerging market for QuickBase and I have been personally rewarded with a deep immersion in Brazilian culture and have had the fantastic opportunity to review all the outstanding talks that are coming in on things you formerly could not do with QuickBase. Overall the hard work is worth the reward of learning about all the feature laden things for which there is seemingly No Way to implement them in QuickBase.

Well one of the latest Mas Que Nada presentations uses a new technique called the "Play the Field" technique and it is truly amazing. The author asked me to give an introduction to this technique because he will assume a familiarity with it for his presentation. Here is how it works ...

Have you ever wanted to create your own field type in QuickBase? How about new fields such as these:

Latitude/Longitude Field 
format: 22.9068° S, 43.1729° W

Brazillian Postal Code Field
format: 12345-678

Brazilian Phone Number Field 
format: AA NNNN-NNNN

DSM-IV Multiaxial Format Field
Axis I 296.32 Major depressive disorder, recurrent, moderate
          305.00 Alcohol use disorder, mild
Axis II V71.09 No diagnosis
Axis III Hypertension
Axis IV Problems with primary support group
Axis V GAF = 48 (Current))

Generic CSV, XML, JSON, YAML Field

Well if you ever needed a composite field similar to one of the above you probably just settled for cramming your data into one or more text fields and just accepting QuickBase's native method of creating, viewing, editing, and reporting your data. Using the Play the Field Technique you no longer have to make this compromise.

In a nutshell the Play the Field Technique uses a multi-line text field to store a raw internal representation of your new field type but dynamically substitutes a more appropriate interface to createview, edit and report the field . In some cases you may choose to never display the raw internal representation of the underlying text field and always present a more convenient stylized version of the new field type. In other cases you may use a specialize interface for a subset of the createviewedit and report interactions but allow direct access on occasion to the raw internal representation of the field using native QuickBase functionality.

For example, a frequent request is for a field to represent a set of selected options. For this particular example you might like to present your field as a set of checkboxes or as a stylized select control such as offered by the Chosen library (See: http://harvesthq.github.io/chosen/). For example if the set of available options were fruit names {Apple, Banana, Cherry, Date} selecting Apple and Cherry options might be saved in the raw internal underlying text field as "Apple,Cherry" but not necessary ever displayed in this raw format.

Enough with the flight of ideas and theoretical narrative - let's see some examples. I do not have the time to fully develop this demo (I have a ton of Mas Que Nada presentations to review) at this moment but the following application demonstrates (to varying degrees of completeness) using an XML Field, a Markdown Field and an Options Field. Most users will be interested in the Options Field based on historic questions in the forum:

Play the Field - List All
https://haversineconsulting.quickbase.com/db/bj3wia74g?a=q&qid=1

Edit one of the two records and then view the saved record to see each new field's unique features in operation.

Here is a highlight of each field's special feature at this point in the demo's development:

XML Field
Pasting XML into the XML field will pretty format the XML using the vkbeautify library after you blur the record. The same pretty formatting is possible for JSONCSV and SQL data using the vkbeautify library. The utility of creating a custom XML, JSON or CSV field is to have a generic way of saving multiple but related values in one field.

Markdown Field
Pasting markdown code into the Markdown Field will be later rendered as HTML using the marked.js library when the record is viewed.

Options Field
The Options Field uses the chosen library to present an stylized select control but stores the selected option as a comma separated text string.

Here is the relevant code used in this example:

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

NOTE: This demo will greatly evolve over time so feel free to ask a question is something seems incomplete or has changed from the last time you looked at it.

Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,204 Points 20k badge 2x thumb

Posted 4 years ago

  • 0
  • 1
Photo of Josiah

Josiah

  • 0 Points
Hey Dan, cool stuff as always, I really enjoy these self-answers for big questions! However, do you think in the future you could write the question and then self-answer it using the answers section? That way people could Upvote your wonderful answers, and (IMO more importantly) all these questions won't be marked as "Unanswered", when they are actually are.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,204 Points 20k badge 2x thumb
You offer a wondrous proposal! Surely the community would benefit from adopting this ingenious forum posting protocol and I could snag some serious forum pointage and rise on the leaderboard. But how to implement it?

So I have this new technique which goes like this ...

     Q: What is the "Submit" Technique?

     Frequently people want to to create or edit a record and save their work without reloading the page. Unfortunately
     QuickBase does not support this feature but it is simple to implement. Here is a demo (permissions are set for you to add
     records):

     Submit
     https://haversineconsulting.quickbase.com/db/bj35bd9q2?a=nwr

     When you click the Submit (not Save) button the record will be saved and the response will be written to a hidden <iframe>
     so you never see the response page and the page remains open for additional editing. But the record is saved.
     Problem solved!

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

     Notes:
     (1) Credits to graffiti artist Shepard Fairey: https://en.wikipedia.org/wiki/Shepard_Fairey
     (2) Keep your form simple if you use this technique to speed your data entry. There could be complications if you form
          submission has errors (eg duplicate field) or invokes conflict resolution as you will not see the any messages as they
          will be routed to the hidden <iframe>

How would I adopt your proposal for sharing this new Submit technique? I am not sure I can answer my own question - I might need a shill to post a the short question: What is the "Submit" Technique?. Then I could come in an post the answer and score some points.
Photo of Josiah

Josiah

  • 0 Points
I'm quite sure you can answer your own question. I just went to one of my previous questions and scrolled down and the "Contribute an answer" button worked perfectly fine. So you should be able to just post a question "What is the 'Submit' Technique?" and then answer it with all your relevant details.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,204 Points 20k badge 2x thumb
>So you should be able to just post a question ... and then answer it with all your relevant details.

I am liking this! With this answer I am going to check "Answered your question? " as the answer was in the question. But in the future I will do this and score a ton of points ...

What Are QuickBase Snippets?
https://quickbase-community.intuit.com/questions/1188325