> For the complete documentation index, see [llms.txt](https://gebra-it.gitbook.io/wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gebra-it.gitbook.io/wiki/client-api-reference/events/onscan.md).

# onScan

The scan events gets triggered when a barcode (or 2D code) is scanned, e.g. by using the wedgeScanner control. You can then ask the control for the scanned code.

## Simple Example

```javascript
    console.log("The scanned code is: " app.getFieldValue("myScannerControlId"));
```

## Example using the [GS1 Splitter business function](/wiki/client-api-reference/functions/businessfunction/gs1-code-splitter.md)

```javascript
let result = await app.businessFunction({
  functionName: "Gs1Splitter",
  methodName: "Split",
  gs1Code: app.getFieldValue("myScannerControlId"),
});
console.log(result);
```
