Templates and Formulas
Design custom labels with integrated barcodes, calculation formulas, dynamic fields and conditional visibility rules. Everything directly on the device, without external servers.
Overview
A template is the "blueprint" of a label: it defines what appears, where it appears, and how each value is calculated. Once created, the template is reused for each print: the actual product data is automatically inserted at the time of printing, without you having to do anything.
SiltaFlow's templating system is designed to be powerful without being complicated. You can create simple labels with just your name and barcode in minutes, or design advanced labels with calculated prices, conditional text, and complex layouts — all using a visual editor and Excel-like formulas.
All label generation takes place on the device, without an internet connection. Once the product data has been loaded from Odoo, you can also print offline.
The Template Editor
To access the editor, go to the Print Product Labels screen and tap the Template Management button. From here you can create new templates or edit existing ones.
When you create a new template, you first set the physical dimensions of the label (width and height in millimeters) and the resolution of the printer you will use. These two values determine the "canvas" you will work on: the editor automatically converts millimeters to pixels based on the printer resolution.
The label canvas
The canvas previews the label in real time. Each item you add immediately appears in the position you set. You can drag items to reposition them, or enter precise numerical coordinates if you need exact positioning.
The Preview button loads a real product from your catalog Odoo and displays the label with the actual product data — including generated barcodes and formula results. It's the quickest way to check that everything is working properly before printing.
Always use preview with a real product before starting a production print. You can thus verify that the formulas give the expected result and that the barcodes are readable at the chosen dimensions.
Available Components
A label is made up of one or more components, each with a specific type. To add a component to the label, tap the + button in the editor and choose the type from the list.
| Component | What does he do | Typical use |
|---|---|---|
| Text | Show static or dynamic text. Supports product variables, formulas, and bold/italic text. | Product name, price, internal code, short description |
| Barcode | Generate and display a barcode or QR code. The data to be encoded can be a product field or a formula. | Barcode EAN-13, QR code with URL Odoo, Code 128 on internal code |
| Rectangle | Draws a rectangle with a colored border and/or fill, with optionally rounded corners. | Frames, section backgrounds, visual separators |
| Line | Draws a straight line between two points, with configurable color and thickness. | Horizontal and vertical separators |
| Image | Shows a fixed image embedded in the template (company logo, icons, pictograms). | Company logo, CE symbol, danger pictograms |
| Table | Show data in rows and columns with configurable borders and headers. | Nutrition tables, technical specifications, list of components |
| Date/Time | Automatically inserts the date and time of the exact moment of printing, in the format you prefer. | Packaging date, label printing date, batch timestamp |
| Form | Draw custom geometric shapes (triangles, arrows, free shapes) with configurable color and border. | Directional arrows, warning triangles, graphic decorations |
Product Dynamic Fields
Dynamic fields allow you to automatically insert product data Odoo into the label. Just write the field name in curly brackets in the component text.
For example, if you write {nome} in the content field of a Text component, it will be replaced with the actual product name when printing. The same works for all product fields available in Odoo.
Most used fields
| Field | What it shows |
|---|---|
{nome} |
The name of the product |
{codice_interno} |
The internal code (reference) of the product in Odoo |
{barcode} |
The product barcode |
{prezzo_vendita} |
The sales price configured in Odoo |
{peso} |
The weight of the product in kg |
{categoria} |
The product category of the product |
{descrizione} |
The internal description of the product |
{lotto} |
The batch number (for products with active traceability) |
All standard fields of Odoo are available as dynamic variables. If you have custom fields in your Odoo, you can use them the same way as long as they are included in the synced fields in the SiltaFlow settings.
Barcode generation
The Barcode component generates the code directly on the device, in just a few milliseconds. You don't need an internet connection to generate the barcodes: the calculation takes place entirely locally.
Each Barcode component has two main settings: the format (the type of code to generate) and the data to encode (which can be a product field, a formula or fixed text). You can also choose whether to show the code text below the bars.
Available formats
| Format | Like | Typical use |
|---|---|---|
| Code 128 | Linear | Internal product codes, batch numbers, picking |
| EAN-13 | Linear | Large-scale retail products and consumer items |
| EAN-8 | Linear | Small products with limited space |
| QR Code | 2D matrix | URL Odoo, link to product sheet, structured data |
| Data Matrix | 2D matrix | Very small labels, pharmaceutical, industrial |
| PDF 417 | Stacked 2D | Transport documents, identity cards |
| Code 39 | Linear | Compatibility with legacy systems |
| ITF | Linear | Secondary packaging (GTIN-14) |
| UPC-A | Linear | North American markets |
| Aztec | 2D matrix | High data density, transportation sector |
| Codabar | Linear | Libraries, blood banks |
| Code 93 | Linear | Logistics, aerospace sector |
| UPC-E | Linear | Small products, compressed UPC format |
If the barcode is difficult to read, increase the size of the Barcode component in the editor. Linear barcodes (Code 128, EAN) require a minimum width of approximately 20 mm to be easily read by any scanner.
Calculation Formulas
Formulas allow you to calculate values at print time, starting from product data. The syntax is similar to that of Excel: functions in uppercase, arguments in parentheses, separated by commas.
You can use formulas in the content field of any Text or Barcode component. For example, to show the price rounded to two decimal places with the euro sign in front, write: CONCAT("€ ", ROUND(sale_price, 2)).
Mathematical functions
| Function | Description | Example |
|---|---|---|
ROUND(valore, decimali) |
Rounds a number to the indicated number of decimal places | ROUND(prezzo_vendita, 2) |
IF(condizione, vero, falso) |
Returns the first value if the condition is true, the second if it is false | IF(prezzo_vendita > 50, "PREMIUM", "STD") |
MIN(a, b, ...) |
Returns the smallest value among those indicated | MIN(prezzo_vendita, prezzo_costo) |
MAX(a, b, ...) |
Returns the largest value among those indicated | MAX(giacenza, 0) |
ABS(valore) |
Returns the absolute value (always positive) | ABS(differenza_inventario) |
SQRT(valore) |
Calculate the square root | SQRT(area) |
Text functions
| Function | Description | Example |
|---|---|---|
CONCAT(a, b, ...) |
Merges multiple texts into one | CONCAT(nome, " - ", codice_interno) |
LEFT(testo, n) |
Takes the first n characters of the text | LEFT(nome, 20) |
RIGHT(testo, n) |
Takes the last n characters of the text | RIGHT(codice_interno, 6) |
MID(testo, inizio, lunghezza) |
Extracts a portion of the text from the indicated location | MID(codice_interno, 3, 4) |
LEN(testo) |
Count the number of characters in the text | LEN(nome) |
UPPER(testo) |
Converts text to uppercase | UPPER(nome) |
LOWER(testo) |
Converts text to lowercase | LOWER(categoria) |
TRIM(testo) |
Removes leading and trailing spaces | TRIM(nome) |
Calculated Fields
Calculated fields are intermediate values that you can define once and reuse in multiple components of the same template. They work like Excel cells: give each calculated field a name, write its formula, and then you can use that name as if it were a product field in any other component.
For example, you can create a calculated field called tax_price with the formula ROUND(sale_price * 1.22, 2). Then in the Text components you can simply write {prezzo_iva} to show the price with VAT, without repeating the formula every time.
Calculated fields can depend on other calculated fields - the system automatically resolves the correct calculation order, so you don't have to worry about defining them in a specific order.
Use calculated fields to simplify complex templates. If you have a long formula that you use in multiple places, create a calculated field with a descriptive name: the template becomes more readable and easier to maintain.
Conditional Visibility
Conditional visibility allows you to show or hide a component based on the characteristics of the product you are printing. Each component can have a rule: if the condition is true, the component appears; if it is false, it does not appear on the label.
This feature is very useful for creating a single template that adapts to different products. Instead of creating separate templates for each case, you create a single template with conditional components.
Practical examples
- Batch field — Shows the batch field only if the product has batch tracking enabled. Condition:
tracciabilita == "lotto" - Word "OFFER" — Shows the word "OFFER" only if the product has an active discount. Condition:
sconto_percentuale > 0 - Expiration Date — Shows the expiration date only for products with a configured expiration date. Condition:
giorni_scadenza > 0 - "PREMIUM" Badge — Shows a colored badge only for products priced above a threshold. Condition:
prezzo_vendita > 100
Visibility rules use the same syntax as formulas: you can use comparison operators (>, <, ==, !=), logical operators (AND, OR), and any product field. The component is visible if the result of the rule is true.
Text with Mixed Formatting
The Text component supports mixed formatting within the same block of text: you can have one word in bold, another in italics, and another in a different color, all in the same component.
To apply formatting, use markup tags in the component content field:
<b>testo in grassetto</b>— for bold<i>testo in corsivo</i>— for italics<u>testo sottolineato</u>— for underlining<font size="18" color="#FF0000">testo</font>— for custom size and color
You can combine formatting with dynamic fields. For example: <code>Prodotto: <b>{nome}</b> — Prezzo: <font color="#E53E3E">€ {prezzo_vendita}</font></code> will show the product name in bold and the price in red.
Multi-Label Layout (Avery Sheets)
If you print on A4 or Letter paper with labels arranged in a grid (like Avery sheets), you can configure the layout directly in SiltaFlow. No external software is needed: the app automatically calculates the position of each label on the page.
Layout configuration
- Rows and Columns — Sets how many labels there are per row and per column. For a 2x5 Avery sheet (10 labels per sheet) enter 2 columns and 5 rows.
- Paper Margins — Sets the top, bottom, left, and right page margins in millimeters. Use the values shown on the label sheet packaging.
- Label Spacing — The horizontal and vertical space between labels. For many Avery sheets the spacing is 0 mm.
- Starting position — If the sheet is already partially used, indicates which cell to start from. For example, if you have already printed the first 4 labels of a sheet of 10, set row 1, column 5 to start from the fifth cell.
Always use the starting position when shooting a partially printed sheet. You avoid wasting paper and save time: you don't need to print a whole sheet if you only need a few labels.
Preset: One Touch Print
A preset saves the complete combination of printer, template and layout configuration under a name of your choice. The next time you need to print, instead of reconfiguring everything from scratch, you simply tap the name of the preset and printing starts immediately.
Presets are especially useful for tasks you repeat often. For example, you can have a "Goods Receiving" preset that uses the warehouse printer Zebra with the receiving label template, and a separate "Price Tags" preset that uses the Brother near the checkouts with the price tag template.
How to create a preset
- Set up the printer, template and layout as you would like to use them
- Tap the Save Preset button in the toolbar
- Give the preset a descriptive name (e.g. "Zebra Warehouse — Standard Label")
- The preset is immediately available in the list. Next time tap on his name to start printing directly.
Presets also save your favorite printer with its connection parameters. Upon use, SiltaFlow attempts to reconnect directly to that printer without having to search again.
Practical Examples
Example 1 — Basic label with name and barcode
The simplest possible template: product name at the top and internal code barcode in the center.
- Create a new template, set the dimensions (e.g. 60 mm × 30 mm) and the printer resolution (203 dpi)
- Add a Text component. In the content field write
{nome}. Set bold and center alignment. - Add a Barcode component below the text. Choose the format Code 128 and set the data to
{codice_interno}. Enable the display of text under the barcode. - Tap Preview to check the result, then save the template.
Example 2 — Price tag with conditional "OFFER" writing
A tag showing the calculated price and the words "OFFER" only for products on promotion.
- Create the template with the dimensions of the tag (e.g. 50 mm × 30 mm)
- Add a Text component for the name:
{nome} - Add a component Text for the price with formula:
CONCAT("€ ", ROUND(prezzo_vendita, 2)). Set font large and bold. - Add a Text component with the text "OFFER". In the component settings, in the Visibility section, set the condition:
sconto_percentuale > 0. Set the text color to red. - As a preview, test with a product with a discount and one without: the word "OFFER" must appear only in the first case.
Example 3 — QR code label pointing to card Odoo
A QR code which, when viewed with any smartphone, directly opens the product sheet in the backend Odoo.
- Create the template with the desired dimensions (at least 40 mm × 40 mm for the QR)
- Add a component Barcode, choose the format QR Code.
- In the given field, use the formula:
CONCAT("https://tuoodoo.com/web#id=", id_prodotto, "&model=product.template"). Replace youroodoo.com with your actual server address Odoo. - Add a Text component below the QR code with the product name and internal code.
- Preview that the QR code is generated correctly, then save.
Tips
Always test formulas in preview before using them in production. If a formula contains an error, the editor shows which component has the problem and a description of the error — debugging is fast even for complex formulas.
You can create chains of calculated fields where one depends on the other. For example: price_vat = ROUND(price_sale * 1.22, 2), then price_label = CONCAT("€ ", price_vat). The system calculates everything in the right order automatically.
Create a separate preset for each recurring operation: one for receiving goods, one for price tags, one for shipping labels. With presets you go from setup to printing with just one touch.
Use conditional visibility to reduce the number of templates you need to manage. A single template with conditional components works well for very different products — it's easier to maintain than ten separate, nearly identical templates.
The Date/Time component always prints the exact time of the physical print. Use it for packaging or production labels: each label will have its own precise timestamp, even in a batch print of hundreds of items.
Requirements
To use the templates and formulas of SiltaFlow you need:
- Android device with version 10 or later
- An account Odoo configured in SiltaFlow (to upload product data)
- A configured compatible printer (see the Supported Printers guide)
- For multi-label layout: Print via Android Print with standard Avery sheets