Scan Code
Opens the camera to read a QR code, a barcode or printed text.
Category: Device · Can fail (wrap it in Try to handle that) · Takes time: the next step waits for it
#When to use it
Use it to read a QR code, a barcode or printed text with the camera: a table number, a product code, a ticket.
#Example
A Scan table button: Scan Code with Into: tableNumber and Kind: Qr. The steps after it can use tableNumber.
#Good to know
- It needs the camera, asked for the same way as Take Photo.
- A QR code or barcode is read as soon as the camera sees it. For Kind: Text, the person taps the text to read. Any reads codes and text.
- On a device that can't scan, like the Simulator, the step fails.
- If the person taps Cancel, the run stops quietly.
#Add it
Select a view, open the Inspector's Actions tab, pick when it runs, tap Add action and choose Scan Code (under Device). Tap the step to open its settings.
#Settings
| Setting | What it does | Kind | Default |
|---|---|---|---|
| Into | Where to save what was read. | Variable | Required |
| Kind | What to look for. | Choice: Qr, Barcode, Text, Any | qr |
#What it gives back
The text that was read.