# Barcode Scanner

## Barcode Scanner Overview

Barcodes and QR codes can be useful features in many types of apps from social apps like WeChat and Venmo to connect friends together or location-based games like scavenger hunts. The Barcode Scanner component uses the camera to read any barcode or QR code.

![](/files/-LrzTfZSt5g5UGaqJ0za)

## Blocks

The Barcode Scanner is among the easiest components to set-up and use. After adding the component to your app, you can connect it with a button and a label like the blocks below.

### Scan

![](/files/-MYdTL2QACD34cpd62Fe)

#### Outputs

| Name          | Data Type  | Data                                                           |
| ------------- | ---------- | -------------------------------------------------------------- |
| value         | text       | value from scanned barcode/QR code                             |
| type          | text       | `barcode` or `QR code`                                         |
| was cancelled | True/False | If user cancelled action, returns `true`; else returns `false` |
| error         | Text       | If error, returns error; else returns `null`                   |

In most cases you'll use the default `back` camera in your mobile device but you also have the option to specify the front camera in certain cases.

![](/files/-LrzVi3yZGE1MRi_HsXC)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.thunkable.com/snap-to-place/barcode-scanner.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
