Show the discount or stock left on a label with dynamic values
Show the discount or stock left on a label with dynamic values
In this article:
- What dynamic values do
- Add a dynamic value to a label
- Show how many items are left
- Show the discount
- Show the label only on the right products
A dynamic value is a placeholder in the label text that Lably replaces with each product's own data. Write the label once, for example "Only {{product.inventory_quantity}} left", and every product shows its own number: "Only 3 left", "Only 12 left".
What dynamic values do
Lably has five dynamic values. They work in labels and badges:
Dynamic value | Code | Example on the store |
|---|---|---|
Product inventory quantity |
| Only 3 left |
Variant inventory quantity |
| Only 2 left |
Discount % |
| SAVE 50% |
Discount amount |
| SAVE $50.00 |
Product metafield | depends on the metafield | 100% cotton |
For metafields, see Use product metafields in label text and display conditions.
Add a dynamic value to a label
- Open the label and go to Label.
- Make sure the type is Text.
- Click the { } button (Dynamic value) at the end of the Text field.
- Select a value from the list.

- Edit the text around the code if needed, for example
Only {{product.inventory_quantity}} left. - Click Save.
The preview in the editor uses a sample number, so it shows "Only 3 left" for every product. Your store shows the real numbers.

{{product.inventory_quantity}}, with both curly braces on each side.Show how many items are left
There are two stock values. Choose the one that fits your products:
- Product inventory quantity
{{product.inventory_quantity}}: the total stock of all variants of the product. It works everywhere: on the product page, on collection cards and on the home page. Use it for most stores. - Variant inventory quantity
{{product.variant_quantity}}: the stock of one variant, for example "Blue / M". It works only on the product page, for the variant that is selected when the page opens. On collection cards the number stays empty, and it doesn't change when the customer selects another variant.

The numbers come from Inventory in your Shopify admin. Keep in mind:
- A product that doesn't track inventory shows 0.
- A product that was sold below zero shows a negative number, for example "Only -1 left".
To avoid these cases, show the stock label only on products that have a positive stock and are running low. See Show the label only on the right products.
Show the discount
The discount values use the Compare-at price of the product:
- Discount %: (Compare-at price − Price) ÷ Compare-at price × 100. A product with Price $399 and Compare-at price $499 shows SAVE 20%.
- Discount amount: Compare-at price − Price. A product with Price $350 and Compare-at price $560 shows SAVE $210.00.
The discount values already include the % sign and the currency, so don't add them to the text yourself. A label with a discount value appears only on products that have a compare-at price higher than the price.
When you select Discount % or Discount amount from the list, Lably replaces the whole label text with a ready template, for example SAVE {{product.save_percent}}. Change "SAVE" to your own word if you like.
For products with variants, Lably uses the selected variant. If no variant is selected, it uses the first available variant.
Show the label only on the right products
A stock value doesn't choose the products: without a condition, the label appears on every product, even on products with plenty of stock. Add a display condition in the Display Conditions block:
Low stock label ("Only 3 left"):
- Click Add condition and select Product inventory.
- Select Stock availability is less than and enter a number, for example 10.
- Click Add condition again, select Product inventory, select Stock availability is greater than and enter 0.
- Next to Products must match, select All.

Now the label appears only on products that have 1 to 9 items left.
Discount label for big sales only ("SAVE 35%"):
- Click Add condition and select Discount percentage.
- Select Is greater than and enter 30.
The label appears only on products with a discount bigger than 30%, and each shows its own discount.
The other matchers for discount conditions are Is equal to, Is not equal to, Is greater than or equal to, Is less than, Is less than or equal to, Is in range, Is not in range, Is empty and Is not empty.
✔️ Next step
Check our articles to learn more about the app's functionality:
- Display conditions: show a label only on the products you choose
- Use product metafields in label text and display conditions
Updated on: 21/10/2026
Thank you!
