ocr¶
The ocr menu action opens the OCR (Optical Character Recognition) scanner. The user points the camera at printed text, selects a recognized text candidate, and the result is passed to the then chain.
Availability
The ocr action is only available in Insight Mobile (iOS and Android) starting with V36.2.
The OCR configuration is passed via actionValues using the ocr key. The available configuration properties are identical to the attribute configuration — see OCR for all options.
Payload¶
The result is available in the then chain as value.$payload.ocr:
| Property | Type | Description |
|---|---|---|
selectedText |
string | The text candidate selected by the user. |
record |
object | (optional) The matched tree record, if findInTree was used. |
text |
string | The full raw text recognized by the OCR engine. |
allLines |
string[] | All lines recognized by the OCR engine before splitting or post-processing. |
result |
unknown | The raw result object returned by the native OCR plugin. |
With scriptFilter¶
{
"label": "OCR Filter",
"icon": "icon-menu-square",
"action": "ocr",
"actionValues": [
{
"ocr": {
"openSingleResult": true,
"split": "words"
}
}
],
"then": {
"action": "scriptFilter",
"actionValues": [
{
"clear": true,
"js": "eqFilter('locationId', value.$payload.ocr.selectedText)"
}
]
}
}
For further details on OCR configuration see OCR.