Advanced: Custom Questions and On-the-Fly Questions

Custom Questions

Custom Questions is a powerful feature that allows developers to code their own question tailored to collect and validate answer data using HTML and JavaScript.

With this feature, you have the flexibility to collect as much data as you want with a workflow that best suits your needs. For example, you could specify the flow of custom questions based on context or answer trees within your script.

Context variables include:

__SCAN_VALUE__

__SCAN_RESPONSE__

__SCAN_STATUS__

You can also format questions in specific ways (date, zip code, phone number, etc.) and also check that an answer fits an expected profile. You can ask one question or many questions with each Custom Question. The core value is that the app user’s answer (or answers) for each Custom Question is saved as part of the official scan record.

For adding custom questions you can use the API or the web UI located on the Questions page and Questions tab when creating a Service. There are two options: URL and HTML. Clearly the most flexible is the URL option but the HTML option is especially valuable if collecting data offline or if you don’t want to use your own servers.

Here’s an example of a Custom Question script that auto inserts the device’s date so the app-user doesn’t have to enter a date. And here’s an example where the app-user can enter any date from a drop-down menu, thus making date entries formatted, quicker to enter and more accurate. Email support if you need a text file of the example scripts for inserting into the Custom Question field.

For basic instructions please see our documentation here.

And here for code examples for the __SCAN_RESPONSE__ variable.

custom questions

Custom “On-the-Fly” Questions

In addition to the standard no-coding options for conditional questions, we offer programmers the option to create “On-the-Fly” questions when using our Postback URL feature. One of the benefits of this option is that you only need to show the app-user these questions if and when you choose to based on the context.  Whereas, with a Custom Question the app user always sees the option to answer a question after a scan.

An On-the-Fly question works like this:

1 – The scan record is posted in real-time to your server

2 – You server will see the barcode value scanned and any answers to questions made by the app-user before submitting the scan

3 – Your script can then process that information and present the app-user with one or more questions to answer – or not present any questions

4 – When the app-user answers those questions, they submit it and then you can ask more questions or, if satisfied, allow the app-user to move on the to the next scan

For instructions please see our documentation here.

in Data Collection