Rule: Add a Value to a Multi-Value Element#
The basic principle of this rule is that it adds another value to an existing element you select.
Extra features#
How does the rule behave in different situations? If:
- the element has no value yet - a new value is added to the first position, so a multi-value element is not created:
<g:additional_image_link></g:additional_image_link>-><g:additional_image_link>new value</g:additional_image_link>
- the element has one value - a new value is added to the next (second) position, creating a multi-value element:
<g:additional_image_link>original valueA</g:additional_image_link>-><g:additional_image_link>original valueA</g:additional_image_link><g:additional_image_link>new value</g:additional_image_link>
- the element already has multiple values (is already multi-value) - a new value is added to the next available position:
<g:additional_image_link>original valueA</g:additional_image_link><g:additional_image_link>original valueB</g:additional_image_link>-><g:additional_image_link>original valueA</g:additional_image_link><g:additional_image_link>original valueB</g:additional_image_link><g:additional_image_link>new value</g:additional_image_link>
Practical examples#
Example 1: Adding another alternative image URL#
1. Creating a new rule:
- Open the “Rules” page.
- Click the New rule button.
2. Selecting the rule type:
- In the Rule type field, select the Add a Value to a Multi-Value Element option.
3. Selecting products:
- In the Query field, choose either All products or create your own Product query for specific products you want the rule to apply to.
4. Choosing the element to change:
- In the Element field, select the element you want to modify.
- In our case, this will be
g:additional_image_link
5. Enter the new value:
- In the New value field, enter
- a text value, for example: a specific URL (https://www…)
- a variable containing the stored value, for example:
%url% - a combination of variable and text, for example:
https://www.my-shop.com/%image_handle%
6. Naming the rule:
- In the last step, enter the rule name, for example: “Add alternative images”
Additional uses#
- Add additional alternative categories.
FAQ#
What is the “Add a Value to a Multi-Value Element” rule for?#
This rule allows you to add a new value to an existing element that supports multiple values (e.g., images, categories, or parameters). It is typically used to add additional image URLs (g:additional_image_link) or alternative categories.
How does the rule behave when the element has no value yet?#
If the element has no value, Mergado creates the first value and the element is not yet considered multi-value.
<g:additional_image_link></g:additional_image_link>
→
<g:additional_image_link>new value</g:additional_image_link>
What happens if the element has one or more values?#
- If it has one value, the new value is added to the next position and the element becomes multi-value.
- If it has multiple values, the new value is added to the first available slot (i.e., as the next item in sequence).
💡 Example:
<g:additional_image_link>originalA</g:additional_image_link>
→
<g:additional_image_link>originalA</g:additional_image_link>
<g:additional_image_link>new_value</g:additional_image_link>
Can I add multiple values at once with this rule?#
Not directly. Each rule adds one value per row. If you want to add multiple values (e.g., multiple image URLs), use multiple rules of this type.
What types of values can be added to the element?#
In the New value field, you can enter:
- a text value, e.g.,
https://www.myshop.com/img123.jpg, - a variable, e.g.,
%url%, - a combination of text and variable, e.g.,
https://cdn.myshop.com/%image_name%.
Can I add a dynamic value from another element with this rule?#
Yes. If you want to add a value from another element, use its variable (e.g., %g:image_link%). Mergado will automatically fill in each product’s value based on this variable during regeneration.
How do I know if my element is multi-value?#
On the Elements page in the project, multi-value elements (e.g., g:additional_image_link) display the maximum number of values in parentheses, e.g., (6x). Such elements can appear multiple times for a single product.
You can find an overview in the documentation: Multi-value elements in Mergado.
Can the rule be used for purposes other than images?#
Yes. The rule can be used, for example, for:
- adding additional categories,
- adding alternative URLs,
- expanding parameter lists (e.g., adding a new parameter for products with a specific query).
Can the added value be limited to certain products only?#
Yes. In the “Query” field, you can choose either All products or create your own query, for example, only for products of a certain brand, category, or with a missing image.
What happens if the element I want to add values to is missing from the feed?#
The rule will not create it automatically – you need to add it manually first:
- Open the Elements page,
- click on New element,
- enter the element name (e.g.,
g:additional_image_link), - and confirm the creation.
Can value addition be scheduled?#
Yes. If you want to add links only during a certain period (e.g., seasonal images), you can enable the rule timer and set specific days or hours when the rule should run.
How do I verify that the value addition was successful?#
After saving and applying the rules or after regenerating the feed:
- open the Elements page or the Products page,
- check that the new value row has appeared,
- or run the Rule walkthrough for a specific product – it will show the rule’s result in real time.
Can this rule replace an existing value?#
No. The rule only adds new values; it does not modify or delete existing ones. If you need to overwrite values, use the Rewrite rule or Bulk rewriting by query.
What should you watch out for when using this rule?#
- After adding the rule, always regenerate the feed.
- If the values do not appear, check the product query and whether the element actually exists.
Can I add a value to an element that is not allowed in the output format?#
If the target element is not supported in the format, Mergado will not include it in the output. In that case, you need to first adjust the project output format or create the element manually on the Elements page.
Can I use this rule to add images from an external spreadsheet (e.g., Google Sheets)?#
Yes. If you have a spreadsheet with image links, you can import them into Mergado using the Import data file (CSV / XML) rule and then add them using this rule. This allows you to combine external data with multi-value elements in the feed.