Dynamic Conditions
With Dynamic Conditions, you can dynamically change the attribute's value based on specific conditions and the values of other attributes.
If you're new to Mulwi's dynamic conditions, we strongly recommend that you first read the explanation of their work below:
How Mulwi's dynamic conditions work
A dynamic condition is made up of cases, which are conditional expressions that return a value if an item meets specific criteria.
Mulwi checks cases from top to bottom and uses the result value of the first case that an item satisfies.
If an item doesn't meet the criteria of any case, the condition returns an undefined value, nil
.
Each case consists of one result value and statements, which are the rules an item must meet for the result value to be used. An item must meet all statements to satisfy a case.
A case can also have zero statements. This type of case satisfies any item and, if reached, always returns a value. We strongly recommend placing such case at the very end of your dynamic condition.
Example
The dynamic condition at the screenshot below determines the product's availability status based on its stock quantity. This condition has two cases: one with a single statement and one without statements at all.
The condition will work in such way: products with quantity more than 0 will have an In stock status, while all other products will be Out of stock.

Dynamic condition that determines availability based on product quantity
Set up a dynamic condition
Building a working conditional logic requires a lot of planning and attention. Therefore, to avoid being distracted by basic settings, we recommend dividing the setup process into two steps: first create an empty dynamic condition, and only then configure the conditional logic.
NOTE
Items are checked based on their attribute values, so it's important to know the context (content type) of a feed for which you set up a dynamic condition. If the feed's context doesn't match the attributes used in the condition, the conditional results may be incorrect.
For guidance on how to find out a feed's context, please see the Common Questions page.
Create an empty dynamic condition
To create an empty dynamic condition, follow these steps:
Steps for creating an empty dynamic condition in Mulwi
- In your Shopify admin, go to Apps > Mulwi Feeds > Feed tools.
- Click Add dynamic condition.
- Fill in the condition's general information:
- Name. Give your condition a descriptive name. You will use this name to find this particular condition among other conditions.
- Internal Code. Enter a unique string of letters, numbers, and symbols without spaces. You will use this code to access this condition in the feed's template.
- Click Save at the top of the page to finish and create a dynamic condition.
Once you've created an empty dynamic condition, you should next configure this condition's logic.
Configure conditional logic
You configure conditional logic in the Cases section of the dynamic condition's configuration page.
You add a new case by clicking the Add case button at the bottom of the Cases section. By default, the new case is added at the end of the dynamic condition. To remove a case, simply click the Remove case button in the case you want removed.
You add a new conditional statement to a case by clicking the Add statement button in the case's Conditions block. To delete a statement, simply click the trash bin icon next to it.
To change the statement's expression, follow these steps:
- Select the attribute to be checked from the statement's leftmost dropdown menu.
- Choose the comparing operator from the dropdown menu next to the attribute selector. The list of available operators depends on the selected attribute's value type.
- Enter the static value for the checked attribute in the statement's rightmost input field.

You set the result value of a case in the case's Result block. There are two ways for providing the result value: by selecting a predetermined attribute, or by writing a Liquid expression that returns a single value.
To select a predetermined attribute as a result value, set Attribute in the leftmost input field and choose the appropriate attribute from the dropdown menu in the rightmost field.
To get result value from a Liquid expression instead, set Expression in the leftmost input field and provide the whole expression as a single line in the rightmost field.
Once you finish configuring the conditional logic, you you can then start using the dynamic condition in feeds.
Use dynamic condition in the feed
Using dynamic conditions is slightly different for prebuilt templates, customized CSV/TXT/XLSX templates, and customized XML templates.
Use dynamic condition in a prebuilt template
To add a dynamic condition to an attribute in a prebuilt feed template, follow these steps:
Steps for adding a dynamic condition to an attribute in a prebuilt feed template
- In your Shopify admin, go to Apps > Mulwi Feeds > Feeds.
- Click Edit next to the feed you need.
- Find the Template section.
- Set Attribute as the data type of the attribute you need.
- In the input field next to the data type selector, choose the appropriate dynamic condition from the dropdown menu.
- Click Save at the top of the page to apply new settings.
Using dynamic condition in a prebuilt feed template
Use dynamic condition in a custom CSV/TXT/XLSX template
To add a dynamic condition to an attribute in a custom CSV/TXT/XLSX template, follow these steps:
Steps for adding a dynamic condition to an attribute in a custom CSV/TXT/XLSX template
- In your Shopify admin, go to Apps > Mulwi Feeds > Feeds.
- Click Edit next to the feed you need.
- Find the Template section.
- Click Edit template.
- In the Columns section of the template editor, find the attribute you need.
- Set Attribute as the attribute's data Type.
- In the Value input field next to the data type selector, choose the appropriate dynamic condition from the dropdown menu.
- Click Save at the top of the page to apply new settings.
Using dynamic condition in a custom CSV/TXT/XLSX feed template
Use dynamic condition in a custom XML template
To add a dynamic condition to an attribute in a custom XML template, follow these steps:
Steps for adding a dynamic condition to an attribute in a custom XML template
- In your Shopify admin, go to Apps > Mulwi Feeds > Feeds.
- Click Edit next to the feed you need.
- Find the Template section.
- Click Edit template.
- In the Template editor, find the attribute you need.
- Add the dynamic condition to the attribute's value using its respective Liquid Object:
XXX.attr_YYY
(hereXXX
is the feed's context (product or variant) andYYY
is the condition's internal code). You can view how to use the Liquid Object of a specific condition by clicking Variables & Filters at the top of the feed template's editor. - Click Save at the top of the page to apply new settings.
Example
Assume that you have:
- An attribute containing an item's gender;
- A dynamic condition with the
gs_gender
internal code; - A custom Google Shopping XML feed in product variant context.
In this case, you would add the dynamic condition to the gender attribute in such way:
<g:gender><![CDATA[{{ variant.attr_gs_gender }}]]></g:gender>
Dynamic conditions examples
Here we've provided examples of some commonly used dynamic conditions.
Add custom label on low-stock items
The dynamic condition at the screenshot below returns a custom label if an item has low stock quantity. Items with higher stock quantity will have an empty result value.
- Product context
- Product variant context
Dynamic condition that adds a label on low-stock products
Dynamic condition that adds a label on low-stock product variants
Determine gender based on item's tags
The dynamic condition at the screenshot below determines an item's gender based on its tag values. Items without explicit tags for gender will be labeled as unisex.
- Product context
- Product variant context

Dynamic condition that determines gender based on product tags

Dynamic condition that determines gender based on product variant tags
Customize description for items in collection
The dynamic condition at the screenshot below adds additional information to descriptions of items in a certain collection. Items not in the collection will have unchanged descriptions.
- Product context
- Product variant context

Dynamic condition that customizes descriptions of products in a collection
