Using Formulas in Catalog Channel Template Rules
Rule outputs can now calculate a value instead of just returning one. Set the output Type to Formula and you can build a pricing calculation out of your product properties, fixed amounts and percentages, for example cost plus freight plus GST plus your markup, all evaluated at publish time.
In this article:
Where to find it
Building a formula
How the calculation is read
Formatting the result
Good to know
Where to find it
Go to Products Catalog > Products Settings > Mapping Templates
Open the channel template you want
Find the marketplace field you want to calculate, for example Listing Price, and in the Value to send column click Rule > Create New
Create a new rule or open an existing one
Under CONDITIONS, set when the rule should run, for example Product Title contains iphone AND Price greater than 1, or leave it empty to apply the formula to every product.
If you want the AND/OR detail too, extend it with: conditions in the same box are joined with AND, and a second box added with + Add condition group is an OR.
In the OUTPUT section, use the Text | Formula switch in the top right corner and choose Formula
The switch is set to Text by default, which behaves exactly as before. Switching to Formula adds the syntax hint under the box and the Format result panel.
Building a formula
+ Insert variable is the blue button on the right of the formula box. It adds a product value into the formula, at the cursor if you have one, and it works on an empty box too.
Each variable becomes a chip with two parts: an optional action on the left (for example Round up) and the property on the right. Hover a chip to see its full path, and use the small x to remove it. Removing a chip also tidies up the sign that joined it.
Type the signs yourself. There is no operator button: + add, - subtract, * multiply, / divide, ( ) brackets and % percent are all typed on the keyboard.
Fixed amounts are typed in, for example 15.30 for a flat freight charge.
Percentages are typed with a percent sign, for example 10%.
Brackets ( ) let you control the order of the calculation.
In Formula mode the variable list is meant to offer numeric properties only, such as Price, Cost, MSRP, Wholesale Price, Business Price, Floor and Ceiling Price, weights and dimensions. A value that is not a number cannot be calculated, so if one does end up in a formula it counts as 0. Always check the result in Live preview before you save.
Live preview
Before saving, use Live preview at the bottom of the rule and search a real product by Title or SKU. Result shows the exact number the rule produces for that product.
📌 Tip: the preview does not recalculate while you are typing. Click anywhere outside the formula box and the Result refreshes. Do not trust the number mid-edit.
How the calculation is read
A percentage applies to the running total on its left. So Cost + 15.30 + 10% adds 10% on top of Cost plus 15.30, not 10% of the cost alone.
Multiply and divide are calculated before add and subtract. Cost + 2 * 3 with a cost of 1 gives 7, not 9.
Brackets are calculated first. (Price + Cost) * 2 with a price of 19.90 and a cost of 1 gives 41.80.
An empty product value counts as 0. If a product has no MSRP, then MSRP + 5 returns 5. Set a fallback on the field if that is not what you want.
Percentages can be subtracted too. Price - 5% takes 5% off the total to its left.
Every sign has to be written. A number placed straight against a variable, such as Cost 2, is rejected with an inline message, because it could mean either multiplication or a single number.
Formatting the result
The Format result panel sits under the formula box and is applied to the final number, after the whole calculation is done.
Round to 2 decimals, the default and the usual choice for prices
Round up
Round down
Keep all decimals
A result of 16.83 becomes 16.83, 17, 16 and 16.83 respectively.
Automatically round up to end with .99 is a separate checkbox, off by default. Tick it and the final number is rounded up to the next .99, so 9.83 becomes 9.99. It can be combined with any of the four options above, and the Example line under the panel shows you what your current combination does to a sample number.
What you can use it for
A formula is worth using whenever the value a marketplace needs is not stored in your catalog, but can be worked out from values that are. A few common cases:
Landed cost pricing. Build your selling price out of what the product actually costs you:
Cost + 15.30 + 10% + 6% + 13%adds freight, GST, your markup and the marketplace fee, one on top of the other.
A different price per channel. The same catalog Price, plus the fee that channel charges:
Price + 13%on the eBay template, a different percentage on the others. Your catalog Price stays untouched.
Tiered markup. Cheap items usually need a bigger percentage than expensive ones. Create one rule per bracket, each with a condition on the cost, for example Cost greater than 100 and less than or equal to 200, and give each rule its own percentage.
Charm pricing. Any calculation can be finished off with Automatically round up to end with .99, so a computed 9.83 goes out as 9.99.
Sale prices.
Price - 15%for a promotion, applied only to the products your conditions match.
A value the marketplace wants but you do not store. Shipping weight with packaging padding, volumetric weight from your dimensions such as
(Length * Width * Height) / 5000, or a unit conversion likePackage Weight * 2.20462for a channel that wants pounds instead of kilos.
An MSRP or compare-at price derived from cost rather than maintained by hand, for example
Cost * 2.
Because the formula only runs on the products your rule's conditions match, and only on the channel this template applies to, you can be as specific as you need without touching your catalog data.
Good to know
An incomplete or invalid formula cannot be saved. A red message appears under the box explaining what is wrong, and the rule stays open.
A formula that cannot produce a number, such as a division by zero, returns an empty value rather than a wrong price.
The same Text | Formula switch is available on the alternative output, if you choose Set output under IF CONDITIONS AREN'T MET.
A saved formula rule reopens exactly as you saved it, with the formula, the rounding option and the .99 setting all restored.
Creating the rule is not enough on its own. Attach it to the field with Set, then Save Changes, or the rule will not be used.
Changes to a template only reach live listings once the products are revised or republished.
Keep the output on Text for anything that is not a calculation. In Text mode a typed expression is sent as literal text.
The calculated value is only sent to the listing on the channel this mapping template applies to. It does not change your product in the Catalog: Cost, Price, MSRP and every other product property keep the values you set. The formula reads those values, it never writes back to them.
Related article: Catalog Channel Templates Rules: Complete Guide.








