Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New article: Barcode/QRCode questions #282

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
99 changes: 99 additions & 0 deletions source/barcode_qrcode_questions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Barcode/QR code question type

The "Barcode/QR code" question type is used for scanning, decoding and capturing
barcodes and QR codes using the device camera. When a code is scanned with the
camera the value (whether numbers or text) stored in the code is captured.

<p class="note">
Barcode/QR code scanning only works when using KoboCollect on mobile devices.
</p>

A wide range of Barcode and QR code formats are supported, including the
following:

- UPC-A
- UPC-E
- EAN-8
- EAN-13
- Code 39
- Code 93
- Code 128
- Codabar
- ITF
- RSS-14
- RSS-Expanded
- QR Code
- Data Matrix
- Aztec
- PDF 417
- MaxiCode

"Barcode/QR code" questions can be used in different scenarios including asset
management or item distribution. For example, you can scan a QR code on a
beneficiary identity card to capture their ID number. You can then use use the
`pulldata()` function to automatically populate fields from a CSV attached to
your project or from a [linked project](dynamic_data_attachment.md) with
information about the beneficiary. You can learn more about the `pulldata()`
function [here](https://xlsform.org/en/#how-to-pull-data-from-csv).

## How to set up the "Barcode/QR code" question type

### Setting up in formbuilder

To add a "Barcode/QR code" question:

- Click the <i class="k-icon k-icon-plus"></i> button to add a new question
- Type the question text, for example "Collect the beneficiary identification
code", then click **ADD QUESTION** or press ENTER on your keyboard
- Choose the question type

![Adding Barcode/QRCode questions](images/barcode_qrcode_questions/adding_barcode_qrcode_questions.gif)

### Setting up in XLSForm

To add a "Barcode/QR code" question in XLSForm, add a question with type
`barcode` as follows:

| type | name | label |
| :------ | :------------- | :------------------------------ |
| barcode | beneficiary_id | Capture the beneficiary ID code |
| survey |

## How "Barcode/QR code" questions are displayed on web forms and KoboCollect

## Default appearance

![Default appearance of Barcode/QRCode questions](images/barcode_qrcode_questions/barcode_qrcode_appearance.png)

## Advanced appearance

When adding the "Barcode/QR code" question type, you can change the appearance
settings to switch from using the default (back) camera of the device to using
the front camera.

### Changing advanced Appearance in formbuilder

Go to the question settings of the "Barcode/QR code" question, and type "front"
in the "Appearance (Advanced)" box

![Changing appearance of Barcode/QRCode questions](images/barcode_qrcode_questions/change_appearance_barcode_qrcode_questions.png)

### Changing advanced Appearance in XLSForm

In XLSForm, you can set the default camera for capturing the "Barcode/QR code"
to be the front camera by typing 'front' in the `appearance` column as follows:

| type | name | label | appearance |
| :------ | :--------------- | :------------------------------ | :--------- |
| barcode | beneficiary_id_2 | Capture the beneficiary ID code | front |
| survey |

<p class="note">
You can download an XLSForm with examples from this article
<a
download
class="reference"
href="./_static/files/barcode_qrcode_questions/barcode_qrcode_questions.xlsx"
>here</a
>.
</p>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Search the knowledge base, browse our resources and visit our forum for more det
select_one_and_select_many
gps_questions
calculate_questions
barcode_qrcode_questions
advanced_calculate
video_question_type
matrix_response
Expand Down