Writing formulas: cheat sheet & guide
How to write formulas in Plytix, and real examples of why you'd want toFormulas let you transform your data without changing the original attribute value. Use them to reformat an attribute's output for a specific Channel or Brand Portal (called an Attribute Transformation), or to calculate a brand new value stored as its own Formula attribute. This guide covers how to use the formula editor, what elements a formula is built from, and includes real use cases for why you'd reach for one in the first place.
You don’t need to memorize formula syntax to get started. The Formula Editor includes a Formula AI Assistant that can write a formula for you from a plain-language description, or fix one that isn’t working. See Using the formula AI Assistant below.
How to use the Formula Editor
After you've created an Attribute Transformation, or a Formula attribute, you can start editing the formula by clicking the settings icon next to the attribute you want to configure. A panel slides out from the right side of the page, this is the Formula Editor.

In the Formula Editor, you'll see a text box. This is where you write your formulas using the available operations, your existing attributes, and text inputs.
Formula syntax, how a valid formula is written, is based largely on Excel, Google Sheets, and Python.
Using the formula AI Assistant
The Formula Editor includes an AI Assistant (Beta), so you don't need to already know the exact syntax or operation names to write a formula.
Above the Formula Editor text box, click Show formula assistant. A panel opens on the right with a few quick-start options:
- Find and fix errors: describe or point out what's wrong with your current formula, and the assistant suggests a corrected version.
- Suggested formula prompts based on your current attribute context, for example, Concat SKU and Label.
- Look for a value in an attribute: a starting point for building a lookup-style formula.
You can also skip the quick-start options and type your own request directly into the Type here... box, describing what you want the formula to do in plain language, then click Send (or press Enter).
The assistant is a good starting point even if you already know formula syntax, it can save time on more complex formulas that combine several operations, like the ones in Common use cases for formulas below.
Always validate and test a formula, whether you wrote it yourself or with the assistant’s help, before relying on it, see How to validate a formula and How to test Formula Attributes below.
How to write a formula
- Use operations.
- Enclose operations in parentheses.
- Insert properties using the
$symbol. Learn more in Formula attributes and transformations. - Insert line breaks using Shift+Enter, enclosed in quotes.
Media attributes (Media Single, Media Gallery, Thumbnail) can’t be referenced within formulas.
Other formula elements:
$$ITEM: represents a value of a Multiselect attribute. Used in operations like MAP and FILTER as a placeholder variable that takes on the attribute’s different values in a loop execution.[Brackets]: used in formulas like JOIN to represent a set or range of values. DLOOKUP uses curly braces ({"key": "value"}) for its dictionary instead.<html>: HTML elements can be used in formulas, combined with operations, to change the style of an attribute’s value, for example, adding bullets or line breaks.#symbol: add notes to your formulas, making complex operations easier to read and troubleshoot. Anything enclosed between two hashtags isn’t part of the operation itself.

The formula editor offers autosuggest for both operations and attributes. For operations, start typing the operation's name. For attributes, type $, and the attribute list appears.


When searching for your own attributes, just type $ followed by the attribute’s name. You don’t need to include the ATT prefix.
How to validate a formula
Validating a formula is essentially asking the system, "Is this written correctly? Do you understand this?"

Once you're finished editing, click Validate formula. One of two things happens:
- You get an error, explaining why the formula isn't written correctly, or
- You see the attribute testing area appear below the Formula Editor.
You can also click Validate and save in the top right corner to validate the formula and close the window in one step.
How to test Formula Attributes
If your formula validates successfully, the testing area appears below the Formula Editor, and the editor itself is disabled while you test.

This area lets you test different possible inputs for your attribute, to make sure your formula produces the result you expect. Attributes without fixed inputs, like numbers or text, show dummy data; attributes with fixed inputs, like Multiselect or Dropdown, show your existing values.
When referencing a Multiselect attribute, the output result includes brackets ([ ]). To remove them, use a JOIN operation before referencing the attribute, following this format: JOIN($YOUR_ATTRIBUTE, "your_separator").
Example, using a Multiselect attribute inside a CONCAT operation:
CONCAT($ATT.ATTRIBUTE, " ", JOIN($ATT.MULTISELECT, ","))
To test attributes:
- Check or change the data for each attribute so you can test the outcome.
- Click Run test.
- Check the result at the bottom of the testing area, and repeat as needed.
Common use cases for formulas
Formulas are useful whenever you need to transform data without changing what's actually stored in Plytix. Here are some real scenarios, combining the operations covered in this guide, to help you see where formulas fit into your own workflow.
Building a dynamic SEO title
Instead of manually writing a unique, SEO-friendly title for every product, combine several attributes into one with CONCAT:
CONCAT($ATT.ATTRIBUTE, " ", JOIN($ATT.MULTISELECT, ","))This keeps your titles consistent across your whole catalog, and updates automatically if any of the underlying attributes change.
Converting units for a specific marketplace
If you store weight in kilograms but a marketplace requires pounds, convert it on the fly with MULTIPLY, without touching your original data:
CONCAT($ATT.BRAND, " ", $ATT.PRODUCT_NAME, " - ", $ATT.SIZE, " ", $ATT.COLOR)This is especially useful when you sell on multiple platforms that each expect different units.
Flagging low stock automatically
Use IF combined with a comparison operation to generate a dynamic status label based on current inventory, rather than updating it by hand:
MULTIPLY($ATT.WEIGHT_KG, 2.20462)Standardizing capitalization from multiple suppliers
If your product data comes from suppliers with inconsistent capitalization habits, PROPER cleans it up on output without requiring a manual edit on every product:
IF(LT($ATT.INVENTORY, 10), "Low Stock", "In Stock")Mapping your categories to a marketplace's required taxonomy
Many marketplaces (like Google Shopping) require product categories to match their own specific taxonomy, which rarely matches how you've organized categories internally. DLOOKUP lets you map your own category values to the required output, without renaming anything in your PIM:
PROPER($ATT.PRODUCT_NAME)Creating a temporary "New Arrival" badge
Combine a date operation with IF to automatically flag products as new for a limited time after creation, without manually removing the badge later:
DLOOKUP($ATT.CATEGORY, {"Outerwear": "Apparel & Accessories > Clothing > Outerwear", "Footwear": "Apparel & Accessories > Shoes"})Removing HTML formatting for platforms that need plain text
If a marketplace or feed doesn't support rich text, strip formatting from an HTML or Plain text attribute with ESCAPEHTML, so you don't need to maintain a separate plain-text version of your descriptions:
IF(GT($ATT.DAYS_SINCE_CREATED, 30), "", "New")Turning a Multiselect attribute into a clean, readable list
Multiselect attributes normally export with brackets around their values. JOIN turns them into a clean, separator-delimited string instead, useful for feeds and exports that expect plain text:
JOIN($ATT.MATERIALS, ", ")Most of these examples combine just one or two operations. As you get comfortable with the syntax, you can nest multiple operations together to handle more specific business logic, for example, combining IF, AND, and a comparison operation to apply several conditions at once.
List of operations
Below are all available operations, listed alphabetically. Click any operation to see its full definition, syntax, and examples.
- ADD_DAYS - Add days to a date
- ADD_MONTHS - Add months to a date
- ADD_YEARS - Add years to a date
- AND - Test multiple conditions
- AVERAGE - Find the average in a numerical dataset
- CEILING - Return a number rounded up based on a multiple
- CONCAT - Concatenate multiple values
- CONTAINS_ALL - Determine if all of a set of values is found within another set
- CONTAINS_ANY - Determine if any of a set of values is found within another set
- COUNTIF - Count the number of occurrences of a value in a string
- DATE_FORMAT - Change the date format
- DECIMAL_FORMAT - Change the decimal format
- DIVIDE - Divide one number by another
- DLOOKUP - Replace values from a dictionary
- EQ - Verify that two values are equal
- ESCAPEHTML - Remove all HTML tags from a text
- ESCAPESTYLE - Remove all styling from a text
- FILTER - Return a list of items that achieve certain conditions
- FIND - Identify the first position of a string found in a text (case sensitive)
- FLOOR - Return a number rounded down based on a multiple
- GT - Strictly greater than
- GTE - Greater than or equal to
- IF - Return a value based on a set of conditions
- IFBLANK - Return a specified value if blank or not
- IFERROR - Return a specified value if error or not
- IFNULL - Return a specified value if null or not
- IS_SUBSTR - Test if a string is found in a particular text
- ISBLANK - Test if a value or field is empty
- INDEX - Returns a specific position from a list of values
- JOIN - Concatenate values with a delimiter
- LEFT - Extract a substring from a string, starting from the leftmost character
- LEN - Count the characters in a string
- LOWER - Convert a string of text to all lowercase
- LT - Strictly less than
- LTE - Less than or equal to
- MAP - Apply an operation to a list of inputs
- MAX - Find the maximum value in a numerical dataset
- MID - Extract a given number of characters from the middle of a string
- MIN - Find the minimum value in a numerical dataset
- MINUS - Subtract one number from another
- MROUND - Round a number to the nearest integer multiple
- MULTIPLY - Return the product of two numbers
- NE - Not equal
- NOT - Return the opposite of the provided logical value
- OR - Test multiple condition options
- PROPER - Capitalize the first letter in each word of a text
- REPLACE - Replace part of a particular string with a different string
- RIGHT - Extract a substring from a string, starting from the rightmost character
- ROUND - Round a number to a specified decimal place
- RSUBSTITUTE - Replace the last occurrence of a string in a text
- SEARCH - Find the first position of a string found in a text (not case sensitive)
- SPLIT - Split a string into substrings based on a delimiter
- SUB_DAYS - Subtract days from a date
- SUB_MONTHS - Subtract months from a date
- SUB_YEARS - Subtract years from a date
- SUBSTITUTE - Replace existing text with a new text in a string (case sensitive)
- SUM - Add a set of numbers together
- SUMIF - Return the sum of items if they meet a certain condition
- TRIM - Remove all spaces in a text string, leaving just a single space between words
- UPPER - Convert a string to all UPPERCASE
Frequently Asked Questions
No. Your original attribute data stays the same. A formula changes how data is displayed or exported, but it never changes the underlying stored value.
An Attribute Transformation reformats an existing attribute’s output for one specific Channel or Brand Portal. A Formula attribute calculates and stores a brand-new value that you can use like any other attribute across your whole account.
Yes. You can nest operations inside each other to handle more complex logic, for example by combining IF, AND, and a comparison operation.
You don’t need to know the syntax. The AI Assistant (Beta) in the Formula Editor can write a formula for you from a plain-language description, or help fix one that isn’t working. To open it, click Show formula assistant above the Formula Editor.