|
1 | 1 | ---
|
2 |
| -title: Scan a barcode in a canvas app | Microsoft Docs |
3 |
| -description: Scan a variety of barcode types, such as UPC and Codabar |
4 |
| -author: fikaradz |
5 |
| -manager: kvivek |
6 |
| -ms.service: powerapps |
7 |
| -ms.topic: conceptual |
8 |
| -ms.custom: canvas |
9 |
| -ms.reviewer: |
10 |
| -ms.date: 10/23/2016 |
11 |
| -ms.author: fikaradz |
12 |
| -search.audienceType: |
13 |
| - - maker |
14 |
| -search.app: |
15 |
| - - PowerApps |
| 2 | +redirect_url: controls/control-new-barcode-scanner |
16 | 3 | ---
|
17 |
| -# Scan a barcode in PowerApps |
18 |
| - |
19 |
| -Scan several types of barcodes by creating a canvas app and running it on a device, such as a phone, that has a camera. The numerical equivalent of the barcode appears in a **Label** control, and you can upload that data to a variety of [data sources](connections-list.md). |
20 |
| - |
21 |
| -If you're unfamiliar with PowerApps, see [Get started](getting-started.md). |
22 |
| - |
23 |
| -## Known limitations |
24 |
| - |
25 |
| -* Barcodes should be at least 1" (2.5cm) high and 1.5" (4cm) wide. |
26 |
| -* To scan barcodes by using a phone, hold it in portrait orientation, and slowly move it from 7" (18cm) to 10" (25cm) away from the barcode. |
27 |
| -* Long barcode types (such as I2of5, which can have 15 or more characters) can give truncated or otherwise incorrect results, especially if the barcode isn't printed clearly. |
28 |
| -* For iPhones and Android devices, you can specify the **Height** property of the **Barcode** control, but a fixed aspect ratio determines its width. |
29 |
| -* You might need to set the **Scanrate** property of the **Barcode** control to **35** or less. |
30 |
| -* To delay running out of memory on devices that are running iOS, set the **Height** property of the **Barcode** control to **700** (or lower) and the **Scanrate** property to **30**. |
31 |
| -* If the device runs out of memory and the app freezes, restart the app. |
32 |
| - |
33 |
| -## Create a blank app |
34 |
| -1. [Sign up for PowerApps](../signup-for-powerapps.md), and then do *either* of the following: |
35 |
| - |
36 |
| -2. [Open PowerApps](https://create.powerapps.com) in a browser on a device that has a camera. |
37 |
| - |
38 |
| -3. Under **Start with a blank canvas or template**, click or tap **Phone layout** in the **Blank app** tile. |
39 |
| - |
40 |
| -  |
41 |
| - |
42 |
| -4. If you haven't used PowerApps before, get familiar with key areas of the app by taking the intro tour (or click or tap **Skip**). |
43 |
| - |
44 |
| -  |
45 |
| - |
46 |
| - > [!NOTE] |
47 |
| - > You can always take the tour later by clicking or tapping the question-mark icon near the upper-right corner and then clicking or tapping **Take the intro tour**. |
48 |
| -
|
49 |
| -## Add a Barcode control |
50 |
| -1. On the **Insert** tab, click or tap **Media**, and then click or tap **Barcode**. |
51 |
| - |
52 |
| -  |
53 |
| - |
54 |
| -2. Ensure that the **Barcode** control is selected by confirming that a selection box (with handles to resize the control) surrounds it. |
55 |
| - |
56 |
| -  |
57 |
| - |
58 |
| -3. On the **Home** tab, click or tap **Barcode1**, and then type or paste **MyScanner** under **Rename**. |
59 |
| - |
60 |
| - > [!TIP] |
61 |
| - > The first **Barcode** control that you add is named **Barcode1** by default. If you delete that control and add another **Barcode** control, it will be named **Barcode2** by default. By manually renaming a control, you ensure that formulas will refer to the control by its correct name. |
62 |
| -
|
63 |
| -  |
64 |
| - |
65 |
| -## Add a Text input control |
66 |
| -1. On the **Insert** tab, click or tap **Text**, and then click or tap **Text input**. |
67 |
| - |
68 |
| - If the **Insert** tab doesn't appear, maximize your PowerApps window. |
69 |
| - |
70 |
| -  |
71 |
| - |
72 |
| -2. Drag the selection box (not the resize handles) around the **Text input** control down until it appears below **MyScanner**. |
73 |
| - |
74 |
| -  |
75 |
| - |
76 |
| -3. With the **Text input** control still selected, ensure that **Default** appears in the properties list, and then type or paste **MyScanner.Text** in the formula bar. |
77 |
| - |
78 |
| -  |
79 |
| - |
80 |
| -## Change the barcode type |
81 |
| -1. On the **Insert** tab, click or tap **Controls**, and then click or tap **Drop down**. |
82 |
| - |
83 |
| -  |
84 |
| - |
85 |
| -2. Move the **Drop down** control so that it appears below the other controls on the screen. |
86 |
| - |
87 |
| -  |
88 |
| - |
89 |
| -3. With the **Drop down** control still selected, ensure that the properties list shows **Items**, and then type or paste this string of text in the formula bar:<br> |
90 |
| - **[Codabar, Code128, Code39, Ean, I2of5, Upc]** |
91 |
| - |
92 |
| -  |
93 |
| - |
94 |
| -4. On the **Home** tab, rename the **Drop down** control to **ChooseType**. |
95 |
| - |
96 |
| -  |
97 |
| - |
98 |
| -5. Click or tap **MyScanner** to select it, ensure that the properties list shows **BarcodeType**, and then type or paste this string of text in the formula bar:<br> |
99 |
| - **ChooseType.Selected.Value** |
100 |
| - |
101 |
| -## Test the app |
102 |
| -1. Open Preview mode by pressing F5 (or by clicking or tapping the play button near the upper-right corner). |
103 |
| - |
104 |
| -  |
105 |
| - |
106 |
| -2. Hold a barcode up to the camera on the device until the numerical component of the barcode appears in the **Label** control. |
107 |
| - |
108 |
| - If the numerical component doesn't appear, try a different option in the **BarcodeType** list. If the correct data still doesn't appear, type the correct number in the **Input text** control. |
109 |
| - |
110 |
| -## Next steps |
111 |
| -* [Connect the app to a data source](add-data-connection.md) and configure the **[Patch](functions/function-patch.md)** function so that users can save results. |
112 |
| -* Add a **[Drop down](controls/control-drop-down.md)** control, and configure it so that users can choose which type of barcode they want to scan. |
113 |
| -* Add a **[Slider](controls/control-slider.md)** control, and configure it so that users can adjust the scan rate or the height of the **Barcode** control. |
| 4 | +Redirect file only - no content included |
0 commit comments