Your browser does not support JavaScript! This site works best with javascript ( and by best only ).How do I combine two variables? | Label LIVE
Back to Data FAQs

How do I combine two variables?

Answer

Use ${VAR1}_${VAR2} in the same design object, or use a scripting variable.

There are two ways to combine two or more variables in Label LIVE.

Using Design Objects

Label LIVE design objects such as Text and Barcode use a special variable format. Read our variable guide for more information.

Example: Names

Combined: {LAST}, {FIRST}

Result: Combined: Larson, Caylan

Example: Telephone

Telephone: +{COUNTRY_CODE} ({AREA_CODE}) {DIGITS}

Result: Telephone: +1 (345) 123-9876

Using Script Variables

Label LIVE designs can use small scripts to combine variables. Read our logic guide for more information. Note that this syntax is JavaScript.

Example: Names

const { variables } = context;
const { FIRST, LAST } = variables;
context.result = LAST + ', ' + FIRST;

Result: Larson, Caylan

Example: Telephone

const { variables } = context;
const { COUNTRY_CODE, AREA_CODE, DIGITS } = variables;
context.result = `+${COUNTRY_CODE} (${AREA_CODE}) ${DIGITS}`;

Result: +1 (345) 123-9876

Other Ways to Concatenate

You can mix and match these techniques. Of course, there are many other ways to combine, split and manipulate variables within Label LIVE's scripting environment. You can use arrays, regular expressions, split, join, replace... the limit is your imagination!

Not the answer you were looking for?

Reach out to us today and we'll see what we can do ASAP.

A blog icon
Guides

How to make Label LIVE work for you, in detail.

Read the guides

Computer monitor icon
Find Answers

If you have questions... we have answers. Check out our in-depth FAQs.

View the FAQs

QR Code Icon
Barcodes

See the barcodes we support and learn how to use them in your labels.

See more barcodes