How to extract data from barcodes

Orca Scan Variables make it easy to extract data from a barcode value
Orca Scan Variables make it easy to extract data from a barcode value

Orca Scan Variables make it easy to extract data from a barcode value and move it to another field. Simply add a variable as a default value to one of your fields and scan a barcode. To get started:

  1. Download the Orca Scan barcode app
  2. Create a new sheet
  3. Add columns/fields for each value you want to extract
  4. Enter an Orca Variable as the default value for each field
    Default value inside the add column dialogue
    Default value inside the add column dialogue
  5. Save the changes
  6. Scan the relevant barcode to see the data extracted

How do Orca Variables work?

Orca Variables have the following structure $TYPE:PROPERTY:FORMAT

There are times when you may need to extract data from an unstructured barcode; that is barcodes that contain data that does not follow a specific standard. In such cases, you would use the $RAW variable listed below.

Orca Scan supports the following:

Barcode Standards

Data Formats

Barcode Standards

GS1

Get data from a GS1 barcode using the following variables:

Use our free GS1 Barcode Decoder to copy the variables easily

Variable GS1 AI Description
$GS1:SSCC 00 SSCC (Serial Shipping Container Code)
$GS1:GTIN 01 8, 12, 13 or 14 Digit GTIN (Global Trade Item Number)
$GS1:CONTENT 02 GTIN of contained trade items
$GS1:LOT 10 Batch or lot number
$GS1:MANUFACTUREDATE 11 Production date
$GS1:DUEDATE 12 Due date
$GS1:PACKINGDATE 13 Packaging date
$GS1:BESTBEFOREDATE 15 Best before date
$GS1:SELLBYDATE 16 Sell by date
$GS1:EXPIRYDATE 17 Expiration date
$GS1:SERIAL 21 Serial number
$GS1:CPV 22 Consumer product variant
$GS1:GDTI 253 Global Document Type Identifier
$GS1:GCN 255 Global Coupon Number
$GS1:GINC 401 Global Identification Number for Consignment
$GS1:GSIN 402 Global Shipment Identification Number
$GS1:GLN 414 GLN (Global location number)
$GS1:GRAI 8003 Global Returnable Asset Identifier
$GS1:GIAI 8004 Global Individual Asset Identifier
$GS1:CPID 8010 Component Part Identifier
$GS1:GMN 8013 Global Model Number
$GS1:GSRN 8018 Global Service Relation Number
$GS1:3340 3340 Area in square metres
$GS1:GTIN8 n/a 8 Digit GTIN (Global Trade Item Number)
$GS1:GTIN12 n/a 12 Digit GTIN (Global Trade Item Number)
$GS1:GTIN13 n/a 13 Digit GTIN (Global Trade Item Number)
$GS1:GTIN14 01 14 Digit GTIN (Global Trade Item Number)
$GS1:AI n/a Replace AI with GS1 Application Identifier num
$GS1:ISVALID n/a True if valid GS1
Variable
$GS1:SSCC
GS1 AI
00
Description
SSCC (Serial Shipping Container Code)
Variable
$GS1:GTIN
GS1 AI
01
Description
8, 12, 13 or 14 Digit GTIN (Global Trade Item Number)
Variable
$GS1:CONTENT
GS1 AI
02
Description
GTIN of contained trade items
Variable
$GS1:LOT
GS1 AI
10
Description
Batch or lot number
Variable
$GS1:MANUFACTUREDATE
GS1 AI
11
Description
Production date
Variable
$GS1:DUEDATE
GS1 AI
12
Description
Due date
Variable
$GS1:PACKINGDATE
GS1 AI
13
Description
Packaging date
Variable
$GS1:BESTBEFOREDATE
GS1 AI
15
Description
Best before date
Variable
$GS1:SELLBYDATE
GS1 AI
16
Description
Sell by date
Variable
$GS1:EXPIRYDATE
GS1 AI
17
Description
Expiration date
Variable
$GS1:SERIAL
GS1 AI
21
Description
Serial number
Variable
$GS1:CPV
GS1 AI
22
Description
Consumer product variant
Variable
$GS1:GDTI
GS1 AI
253
Description
Global Document Type Identifier
Variable
$GS1:GCN
GS1 AI
255
Description
Global Coupon Number
Variable
$GS1:GINC
GS1 AI
401
Description
Global Identification Number for Consignment
Variable
$GS1:GSIN
GS1 AI
402
Description
Global Shipment Identification Number
Variable
$GS1:GLN
GS1 AI
414
Description
GLN (Global location number)
Variable
$GS1:GRAI
GS1 AI
8003
Description
Global Returnable Asset Identifier
Variable
$GS1:GIAI
GS1 AI
8004
Description
Global Individual Asset Identifier
Variable
$GS1:CPID
GS1 AI
8010
Description
Component Part Identifier
Variable
$GS1:GMN
GS1 AI
8013
Description
Global Model Number
Variable
$GS1:GSRN
GS1 AI
8018
Description
Global Service Relation Number
Variable
$GS1:3340
GS1 AI
3340
Description
Area in square metres
Variable
$GS1:GTIN8
GS1 AI
n/a
Description
8 Digit GTIN (Global Trade Item Number)
Variable
$GS1:GTIN12
GS1 AI
n/a
Description
12 Digit GTIN (Global Trade Item Number)
Variable
$GS1:GTIN13
GS1 AI
n/a
Description
13 Digit GTIN (Global Trade Item Number)
Variable
$GS1:GTIN14
GS1 AI
01
Description
14 Digit GTIN (Global Trade Item Number)
Variable
$GS1:AI
GS1 AI
n/a
Description
Replace AI with GS1 Application Identifier num
Variable
$GS1:ISVALID
GS1 AI
n/a
Description
True if valid GS1

Note: If the barcode scanned is not a valid GS1 barcode, no data is returned.

HIBC

Extract data from a Health Industry Bar Code (HIBC) using the following variables:

Use our free HIBC Barcode Decoder to copy the variables easily

Variable Description
$HIBC:BARCODE Correctly formatted HIBC barcode
$HIBC:TYPE Concatenated, Line1 or Line2
$HIBC:LIC Labeler Identification Code
$HIBC:UOM Unit Of Measure
$HIBC:PCN Product or Catalog Number
$HIBC:EXPIRYDATE Expiry Date
$HIBC:LOT Lot number
$HIBC:QUANTITY Quantity
$HIBC:CHECK Check character
$HIBC:ISCONCATENATED True if concatenated HIBC
$HIBC:ISPRIMARY True if primary HIBC
$HIBC:ISSECONDARY True if secondary HIBC
$HIBC:ISVALID True if valid HIBC
Variable
$HIBC:BARCODE
Description
Correctly formatted HIBC barcode
Variable
$HIBC:TYPE
Description
Concatenated, Line1 or Line2
Variable
$HIBC:LIC
Description
Labeler Identification Code
Variable
$HIBC:UOM
Description
Unit Of Measure
Variable
$HIBC:PCN
Description
Product or Catalog Number
Variable
$HIBC:EXPIRYDATE
Description
Expiry Date
Variable
$HIBC:LOT
Description
Lot number
Variable
$HIBC:QUANTITY
Description
Quantity
Variable
$HIBC:CHECK
Description
Check character
Variable
$HIBC:ISCONCATENATED
Description
True if concatenated HIBC
Variable
$HIBC:ISPRIMARY
Description
True if primary HIBC
Variable
$HIBC:ISSECONDARY
Description
True if secondary HIBC
Variable
$HIBC:ISVALID
Description
True if valid HIBC

Note: If the barcode scanned is not a valid HIBC barcode, no data is returned.

ISBT

Get data from an ISBT barcode using the following variables:

Variable Description
$ISBT:DI Device Identifier for Blood Container
$ISBT:SERIAL Serial Number
$ISBT:DIN Donation Identification Number
$ISBT:EXPIRYDATE Expiration Date
$ISBT:MANUFACTUREDATE Manufacturing Date
$ISBT:LOT Lot Number
$ISBT:ISVALID True if valid ISBT
Variable
$ISBT:DI
Description
Device Identifier for Blood Container
Variable
$ISBT:SERIAL
Description
Serial Number
Variable
$ISBT:DIN
Description
Donation Identification Number
Variable
$ISBT:EXPIRYDATE
Description
Expiration Date
Variable
$ISBT:MANUFACTUREDATE
Description
Manufacturing Date
Variable
$ISBT:LOT
Description
Lot Number
Variable
$ISBT:ISVALID
Description
True if valid ISBT

Note: If the barcode scanned is not a valid ISBT barcode, no data is returned.

UDI

UDI barcodes can be encoded using the GS1, HIBC or ISBT barcode standard. Using the $UDI variable allows you to extract the correct data, regardless of the standard used. To get data from a UDI barcode, use the following variables:

Use our free UDI Barcode Decoder to copy the variables easily

Variable Description
$UDI:DI Device Identifier (GTIN, PCN)
$UDI:LOT Lot Number
$UDI:EXPIRYDATE Expiration Date
$UDI:SERIAL Serial Number
$UDI:PRODDATE Production/Manufacture Date
$UDI:TYPE Data structure GS1, HIBC or ISBT
$UDI:ISVALID True if valid UDI
Variable
$UDI:DI
Description
Device Identifier (GTIN, PCN)
Variable
$UDI:LOT
Description
Lot Number
Variable
$UDI:EXPIRYDATE
Description
Expiration Date
Variable
$UDI:SERIAL
Description
Serial Number
Variable
$UDI:PRODDATE
Description
Production/Manufacture Date
Variable
$UDI:TYPE
Description
Data structure GS1, HIBC or ISBT
Variable
$UDI:ISVALID
Description
True if valid UDI

Note: If the barcode scanned is not a valid UDI barcode, no data is returned.

FMD

Get data from an FMD barcode using the following variables:

Use our free FMD Barcode Decoder to copy the variables easily

Variable Description
$FMD:PRODUCTCODE Product Code
$FMD:SERIAL Serial Number
$FMD:LOT Lot or Batch Number
$FMD:EXPIRYDATE Expiration Date
$FMD:NHRN National Healthcare Reimbursement Number
$FMD:ISVALID True if valid FMD
Variable
$FMD:PRODUCTCODE
Description
Product Code
Variable
$FMD:SERIAL
Description
Serial Number
Variable
$FMD:LOT
Description
Lot or Batch Number
Variable
$FMD:EXPIRYDATE
Description
Expiration Date
Variable
$FMD:NHRN
Description
National Healthcare Reimbursement Number
Variable
$FMD:ISVALID
Description
True if valid FMD

Note: If the barcode scanned is not a valid FMD barcode, no data is returned.

Data Formats

JSON

Get values from a barcode containing JSON data:

Variable Description
$JSON:KEY Replace KEY with property name
$JSON:ISVALID True if valid JSON
Variable
$JSON:KEY
Description
Replace KEY with property name
Variable
$JSON:ISVALID
Description
True if valid JSON

Note: If the barcode scanned does not contain valid JSON, no data is returned.

URL

Get data from a URL barcode using the following variables:

Variable Description
$URL:RAW The full URL
$URL:PROTOCOL The URL protocol http or https
$URL:HOST Host and port number if present example.com:8080
$URL:HOSTNAME Just the host name example.com
$URL:PORT Port number 8080 or empty string if not specified
$URL:PATHNAME Path portion of the URL /directory/file.html
$URL:SEARCH URL search/query params
$URL:HASH Hash from the URL if present
$URL:USERNAME Username from the URL if present
$URL:PASSWORD Password from the URL if present
$URL:BASE Base portion of the URL https://example.com
$URL:ISVALID True if valid URL
Variable
$URL:RAW
Description
The full URL
Variable
$URL:PROTOCOL
Description
The URL protocol http or https
Variable
$URL:HOST
Description
Host and port number if present example.com:8080
Variable
$URL:HOSTNAME
Description
Just the host name example.com
Variable
$URL:PORT
Description
Port number 8080 or empty string if not specified
Variable
$URL:PATHNAME
Description
Path portion of the URL /directory/file.html
Variable
$URL:SEARCH
Description
URL search/query params
Variable
$URL:HASH
Description
Hash from the URL if present
Variable
$URL:USERNAME
Description
Username from the URL if present
Variable
$URL:PASSWORD
Description
Password from the URL if present
Variable
$URL:BASE
Description
Base portion of the URL https://example.com
Variable
$URL:ISVALID
Description
True if valid URL

Note: If the barcode scanned is not a valid URL, no data is returned.

CSV

Get values from a barcode that contains CSV data:

Variable Description
$CSV:ROW1 Replace 1 with row number to get full row
$CSV:ROW1COL1 Replace 1 with row and column number to get cell value
Variable
$CSV:ROW1
Description
Replace 1 with row number to get full row
Variable
$CSV:ROW1COL1
Description
Replace 1 with row and column number to get cell value

Using the following as input:

Col1,Col2,Col3,Col4
A1,B1,C1,D1
A2,B2,C2,D2
A3,B3,C3,D3

PSV

Get values from a barcode that contains Pipe Separated data:

Variable Description
$PSV:ROW1 Replace 1 with row number to get full row
$PSV:ROW1COL1 Replace 1 with row and column number to get cell value
Variable
$PSV:ROW1
Description
Replace 1 with row number to get full row
Variable
$PSV:ROW1COL1
Description
Replace 1 with row and column number to get cell value

Using the following as input:

Col1|Col2|Col3|Col4
A1|B1|C1|D1
A2|B2|C2|D2
A3|B3|C3|D3

TSV

Get values from a barcode that contains Tab Separated data:

Variable Description
$TSV:ROW1 Replace 1 with row number to get full row
$TSV:ROW1COL1 Replace 1 with row and column number to get cell value
Variable
$TSV:ROW1
Description
Replace 1 with row number to get full row
Variable
$TSV:ROW1COL1
Description
Replace 1 with row and column number to get cell value

Using the following as input:

Col1	Col2	Col3	Col4
A1	B1	C1	D1
A2	B2	C2	D2
A3	B3	C3	D3

RAW

Get data from a barcode value regardless of the format used:

Variable Description
$RAW:GET Get full value
$RAW:GET:FIRST3 Get first 3 characters
$RAW:GET:LAST3 Get last 3 characters
$RAW:GET:EX3 Get all but first 3 characters
$RAW:GET:EX-3 Get all but last 3 characters
Variable
$RAW:GET
Description
Get full value
Variable
$RAW:GET:FIRST3
Description
Get first 3 characters
Variable
$RAW:GET:LAST3
Description
Get last 3 characters
Variable
$RAW:GET:EX3
Description
Get all but first 3 characters
Variable
$RAW:GET:EX-3
Description
Get all but last 3 characters

Using the following as input:

Hello World

Formatting

The third segment of an Orca Variable $TYPE:PROPERTY:FORMAT is used to format the result. By default, all values from known barcode standards are returned in the correct format (dates, weights, etc). You can use the FORMAT segment to modify the output to suit your needs:

1. True/False

You can convert the value into a boolean (true or false) using the following token:

Token Description
EXISTS Returns true if the value is not empty, otherwise false
BOOL Returns true if the value true or 1 otherwise false
Token
EXISTS
Description
Returns true if the value is not empty, otherwise false
Token
BOOL
Description
Returns true if the value true or 1 otherwise false

2. Dates

You can convert a date into another format using a combination of the following tokens:

Token Description Example output
DDDD Full day name Saturday
DDD 3 character day name Sat
DD Day in double-digit format 02
D Day in single-digit format 2
MMMM Full name of month January
MMM Month in 3 character format Jan
MM Month in double-digit format 03
M Month in single-digit format 3
YYYY 4 digit year 2019
YYY 3 digit year 019
YY 2 digit year 19
CC 2 digit century 20
HH 2 digit hour 03
H 1 digit hour 3
mm 2 digit minute 02
m 1 digit minute 3
Token
DDDD
Description
Full day name
Example output
Saturday
Token
DDD
Description
3 character day name
Example output
Sat
Token
DD
Description
Day in double-digit format
Example output
02
Token
D
Description
Day in single-digit format
Example output
2
Token
MMMM
Description
Full name of month
Example output
January
Token
MMM
Description
Month in 3 character format
Example output
Jan
Token
MM
Description
Month in double-digit format
Example output
03
Token
M
Description
Month in single-digit format
Example output
3
Token
YYYY
Description
4 digit year
Example output
2019
Token
YYY
Description
3 digit year
Example output
019
Token
YY
Description
2 digit year
Example output
19
Token
CC
Description
2 digit century
Example output
20
Token
HH
Description
2 digit hour
Example output
03
Token
H
Description
1 digit hour
Example output
3
Token
mm
Description
2 digit minute
Example output
02
Token
m
Description
1 digit minute
Example output
3

Using the following GS1 barcode value as an example:

01050601301313832152888501717543172303311000327C

3. Characters

You can extract only a specific number or type of characters using the token below, followed by the number of characters:

Token Description
N Numeric digit
A Alpha character
X Alphanumeric character
FIRST First n characters from the left
LAST Last n characters from the right
EX All but n number of characters
Token
N
Description
Numeric digit
Token
A
Description
Alpha character
Token
X
Description
Alphanumeric character
Token
FIRST
Description
First n characters from the left
Token
LAST
Description
Last n characters from the right
Token
EX
Description
All but n number of characters

You must follow each token with a number of characters, for example:

Example Description
N3 3 numeric digits
A3 3 alpha characters
X3 3 alphanumeric characters
N..3 0 to 3 numeric digits
A..3 0 to 3 alpha characters
X..3 0 to 3 alphanumeric characters
FIRST3 Take the FIRST 3 characters
LAST3 Take the LAST 3 characters
EX3 Excludes all but FIRST 3 characters
EX-3 Excludes all but LAST 3 characters
Example
N3
Description
3 numeric digits
Example
A3
Description
3 alpha characters
Example
X3
Description
3 alphanumeric characters
Example
N..3
Description
0 to 3 numeric digits
Example
A..3
Description
0 to 3 alpha characters
Example
X..3
Description
0 to 3 alphanumeric characters
Example
FIRST3
Description
Take the FIRST 3 characters
Example
LAST3
Description
Take the LAST 3 characters
Example
EX3
Description
Excludes all but FIRST 3 characters
Example
EX-3
Description
Excludes all but LAST 3 characters

Using the following barcode value as an example:

Orca Scan

System Variables

The following variables provide access to User and Date information:

Variable Description
$USER:EMAIL Get email address of the user
$DATE:NOW Get the current date and time
Variable
$USER:EMAIL
Description
Get email address of the user
Variable
$DATE:NOW
Description
Get the current date and time

Using Variables With Triggers

Variables can be used within triggers to set conditions and specify actions.

Examples

Trigger conditions needed to be notified when you are low on stock
Trigger conditions needed to be notified when you are low on stock
Trigger conditions needed to capture the user that delivered the parcel to the customer
Trigger conditions needed to capture the user that delivered the parcel to the customer

For detailed instructions on creating triggers, check out our triggers guide.

Need help using Orca Variables?

chat with us live or email us at hello@orcascan.com.


Was this guide helpful?

Ready to start scanning?

Close Icon
Get the Orca scan app QR code

Scan the QR code to download the mobile app

Scan the QR code to open this guides on your mobile device