^FN - Field Number
Numbers a field so a stored format can fill it in later.
^FN gives a field a number, so the data and the layout can travel separately. In
a format that ^DF stores, ^FN takes the place of ^FD and marks the field as
one to fill in. In a label that recalls the format with ^XF, ^FN pairs with
^FD to supply that field's data. Outside a stored format, ^FN does nothing.
Syntax
^FN#Support
Every documented parameter renders the same output Labelary produces.
Inside a stored format the command marks the place a value goes. On recall the renderer replaces it with the data the recalling label gives that field number. A field number the recall does not bind renders nothing. Measured against Labelary on 2026-08-20. — not pinned by a test
Labelary renders this command.
Parameters
#Field numberoptional · integerNumber that identifies this field within a stored format. ^FN in the recalling label supplies the data for the field with the same number.
- Default
- 0
- Accepted range
- 0 to 9999
- Invalid value
- discarded, and the default applies
- Test coverage
- Bounds pinned: maximum (9999), above the maximum (10000). No test at the minimum. The invalid-value rule is not pinned by a test.
Behavior
The number is a label, not an index: the numbers can come in any order, and several
fields can carry the same number, so one ^FD fills all of them. That is the
intended way to print one value twice, as text and inside a bar code, without
sending it twice.
Order matters between the recall and the data. ^XF recalls the stored layout, and
the ^FN/^FD pairs after it fill the numbered fields. A pair before the ^XF
has nothing to attach to. The recalling label does not position the field again,
because the origin, font and rotation come from the stored format.
A field with both ^FN and ^FD in the same format prints its data directly, and
the guide states that this data also fills any other field with the same number.
The practical limit is memory, not the 0 to 9999 range: the guide recommends fewer
than 400 numbered fields.
Tested behavior
Differences from the specification
zpl.tools against Labelary
Where our output differs from Labelary for the same input. These are the differences that break a migration.
- Labelary fills numbered fields from a recalled
^DFformat; the renderer does not, so those fields are blank. — not pinned by a test
Example
A layout stored under R:TPL.ZPL and then recalled with the data for its two numbered fields. One label comes out, not two — the storing format prints nothing of its own:
^XA
^DFR:TPL.ZPL^FS
^FO50,40^A0N,30,30^FN1^FS
^FO50,90^A0N,30,30^FN2^FS
^XZ
^XA
^XFR:TPL.ZPL^FS
^FN1^FDPART 4471^FS
^FN2^FDQTY 12^FS
^XZ
Related commands
^DFDownload FormatStores the rest of the label as a reusable format instead of printing it.^XFRecall FormatRecalls a stored format and merges the current label's data into it.^FVField VariableSupplies field data the printer clears after the label prints, unlike `^FD`.^FDField DataSupplies the text or barcode content of the field.