VectorLabel is in beta. These pages describe the current beta builds, which are pre-release software: what they say may change before the first production release, and parts marked Beta are new or still being tested. Downloading the beta needs an account with VectorLabel beta access (ask for it here). Tell us if something here is wrong.
Formulas are Excel-style, always start with =, and work on text. They give the same result in the preview, the print window and on the printed label.
Functions
These eight are the whole set:
IF(condition, if_true, if_false)gives the second value when the condition is true, otherwise the third. Any text that isn't empty counts as true, including"0"and"false"; empty text counts as false.LEFT(text, n): the first n characters (1 if n is left out; 0 gives nothing).RIGHT(text, n): the last n characters (1 if n is left out).MID(text, start, length): length characters from position start, counting the first character as 1.LEN(text): the number of characters.UPPER(text)andLOWER(text): upper or lower case.TRIM(text): removes spaces at the start and end.
There is no arithmetic (+ - * /), no CONCATENATE, no FIND, SEARCH or SUBSTITUTE, and no number formatting.
Joining and comparing
&joins two values into one:Number&" - "&Cablegives "N044 - RIO 1 PRI".=and<>compare text: equal and not equal.( )group, and numbers and"quoted text"can be used as they are. A whole number prints without a decimal point (2, not 2.0).
A comparison works only straight after a field name, with one value on its right, as in Number<>"" or Side="Source". You can't compare two expressions or chain comparisons.
A formula with a mistake in it prints as empty text, not an error message. If a box comes up blank, check the live preview.
Because any non-empty text is true, IF(Field, …) is true even for "0". Write IF(Field<>"", …) when you mean "is this column filled in".
Field names
Write a field by its column key or its display name (see The built-in cable columns), in any case. A name that is more than letters, digits and underscores goes in square brackets: [Length (m)], [Cable #], [Src.Port]. A ] inside a name is written ]]. A bracketed field works anywhere a plain one does, including comparisons like [Other Device]<>"". You rarely type the brackets yourself: a field you insert as a chip gets them when it needs them.
Quote marks in text
Inside quoted text, "" is one quote mark, so "12""" prints 12".
Curly quotes, which macOS smart quotes produce, also work as quotes in formulas, so a template damaged by smart quotes prints correctly without being opened. Inside text that starts with a straight ", a curly quote ends the text only when it is directly followed by &, or by a comma and something other than a space, as in "12”&… or "6”,12”". Anywhere else it prints as written, so "12” " and "(“spare”)" print as they look. Opening a template never changes a curly quote; the formula box points one out instead (see Quotes and smart quotes).
A formula that uses only plain field names and no "" is saved exactly as older versions saved it, so they can still read it. Older versions don't understand square brackets or "", so a formula with either won't print the same in them.
Square-bracket field names and "" are new in 1.20.0-beta.7. Curly quotes working as quotes is new in this beta too; production 1.19.1 has none of it.
Formulas to copy
The first four are the ones in the built-in label template.
The cable number and name, with no dash when there is no name, and just the name when there is no number:
=IF(Number<>"",Number&IF(Cable<>""," - "&Cable,""),IF(Cable<>"",Cable,""))
A connector, only when there is one:
=IF(Connector<>"",Connector,"")
A rack, only when there is one:
=IF(Rack<>"",Rack,"")
The far end as "@ Device : Socket", leaving out the socket when it is blank, and nothing at all when there is no other device:
=IF(Other_Device<>"","@ "&Other_Device&IF(Other_Socket<>""," : "&Other_Socket,""),"")
More:
=UPPER(Cable) everything in capitals
="CBL-"&Number a prefix on every value
=LEFT(Number,3) the first three characters
=RIGHT(Cable,4) the last four characters
=TRIM(Device_Name) no stray spaces from imported data
=IF(Device_Name<>"",Device_Name&IF(Socket_Name<>""," / "&Socket_Name,""),"")
The last one joins two columns with a slash, adding the slash only when both are filled in.
When joining, wrap each optional piece in IF(col<>"", …, ""), so a label never shows a lone dash, slash or "@". The formula editor (Editor ⤢) has a live preview with ‹ › to step through real rows before you apply it.