Skip to main content

Visual Formatter Page (Examples)

This section shows some example usages for the Visual Formatter.

Code manipulation and type check

The following examples show how to use the visual formatter to manipulate the barcode string, as well as run some checks on the barcode type in order to execute the operations only for certain types of barcode.

Sample 1

If the barcode type is a CODE128, the barcode text contains "00", and there are at least 18 characters after the "00" (20 characters including the "00"), return 18 characters after "00". Otherwise, return the original code.

Visual Formatter Sample 1

Download Sample 1

Sample 2

If the barcode type is a CODE128, the barcode text starts with "A", and the length is 14 characters, return the barcode text without the first character and with "00" as prefix. Otherwise, return the original code.

Visual Formatter Sample 2

Download Sample 2

Sample 3

If the barcode type is a CODE128 GS1, add "]C1" as prefix. Otherwise, return the original code.

Visual Formatter Sample 3

Download Sample 3

Sample 4

If the barcode type is a QRCODE or DATAMATRIX and the length is >= 2, remove the first 2 characters. Otherwise, return the original code.

Visual Formatter Sample 4

Download Sample 4

Sample 5

If the barcode type is EAN8, remove the first character and skip the standard formatter. Otherwise, return the original code.

Visual Formatter Sample 5

Download Sample 5

Sample 6

If the barcode type is DATAMATRIX, return the code removing all "X" characters. Otherwise, return the original code.

Visual Formatter Sample 6

Download Sample 6

Dispatcher usage

Sample 1

If the barcode length is >= 2 and the barcode type is QRCODE, remove the first 2 characters from the barcode. If the barcode length is >= 2 and the barcode type is DATAMATRIX, remove the last 2 characters from the barcode. Otherwise, keep the original barcode.

Dispatcher

Visual Formatter Sample 1 Dispatcher

Formatter 1

Visual Formatter Sample 1 Formatter 1

Formatter 2

Visual Formatter Sample 1 Formatter 2

Download Sample 1

Sample 2

Same as Sample 1 from Code manipulation and type check but done using a Dispatcher to simplify the charts.

If the barcode type is a CODE128, the barcode text contains "00", and there are at least 18 characters after the "00" (20 characters including the "00"), return 18 characters after "00". Otherwise, return the original code.

Dispatcher

Visual Formatter Sample 2 Dispatcher

Formatter

Visual Formatter Sample 2 Formatter

Download Sample 2

Sample 3

CODE32 is managed by the standard formatter, so a dispatcher is required to first run the standard formatter when it is needed to manipulate CODE32. In this example the first character of CODE32 will be removed, while for other barcode types no manipulation is done.

Dispatcher

Visual Formatter Sample 3 Dispatcher

Formatter

Visual Formatter Sample 3 Formatter

Download Sample 3

Properties usage

Sample 1

Adding custom inputs for prefix and suffix values. This is similar to what is done by the standard formatter but can be used also to add strings in any position inside the barcode.

Visual Formatter Sample 1 Formatter Properties

Download Sample 1

Sample 2

Adding a custom output set to true when the last barcode has been rejected. In the example, all barcodes that are not QRCODE are rejected and the output boolean is set to true.

Visual Formatter Sample 2 Formatter Properties

Download Sample 2

Sample 3

Adding a custom variable that counts the number of received barcodes that start with "0".

Visual Formatter Sample 3 Formatter Properties

Download Sample 3

Actions usage

Sample 1

Send Ctrl+A key events before sending the barcode.

NOTE: You can also add a delay after the Ctrl+A events to avoid sending the barcode before the key events have been processed by the system.

Visual Formatter Sample 1 Actions

Download Sample 1

Sample 2

Send an intent to start an activity from a test application, including the barcode string as an extra.

Visual Formatter Sample 2 Actions

Download Sample 2

Events usage

Sample 1

In case of barcode read, send the barcode without processing. In case of timeout, send a QR code with the string "TIMEOUT" as result.

Visual Formatter Sample 1 Events

Download Sample 1

Sample 2

Send an intent on decoding start. Send the normal barcode when received.

Visual Formatter Sample 2 Events

Download Sample 2