Multi Attribute Import
Importing Multiple Attributes In An Addtional XML Import
Regenerating and importing the main Tweakwise feed can take a lot of time, which can have a big impact on the duration of your entire update chain. That's why we introduced a way to update multiple attributes using one separate feed that can be loaded more frequently.
This extra import runs on top of your regular catalog sync. It is perfect for enriching products with rapidly changing data from secondary sources (like an ERP) without triggering a full sync. Common use cases for this frequent update include:
- Pricing
- Stock
- Sales performance data
By grouping attributes within a single <item> node, you keep your feed clean and optimize the import process. We'll also cover how to handle multi-value attributes (like multiple sizes).
Implementation
To import multiple attributes, you need to nest <attribute> tags within an <attributes> container inside your <item>.
Here is the exact XML structure you should use:
<?xml version="1.0" encoding="utf-8"?>
<items>
<item>
<id>1143</id>
<attributes>
<attribute>
<name>performance-purchases-30days</name>
<values>
<value>100</value>
</values>
</attribute>
<attribute>
<name>sizes</name>
<values>
<value><![CDATA[XL]]></value>
<value><![CDATA[L]]></value>
</values>
</attribute>
</attributes>
</item>
</items>Breaking down the structure:
<id>: The unique identifier for your item. This should match the ID in your main Tweakwise catalog or any other attribute, like EAN or SKU.<name>: The identifier for the attribute (e.g.,performance-purchase-30days,sizes).<value>: The actual value of the attribute.
Notes & Important Considerations
- Attribute Existence: Make sure the attributes you want to import already exist in your Tweakwise instance. If they do not exist, you must create them before running the import.
- Attribute Matching: This import only matches default attributes. Furthermore, the matching is strictly based on the attribute's name, not the
UrlName. - Validation Rules & Error Handling: Keep the following data rules in mind to prevent import issues:
- Whitespace & Empty Values: Values are automatically trimmed. Empty values are skipped entirely.
- Length Limits: Values exceeding 400 characters are truncated (this will trigger a warning). Item IDs longer than 100 characters will result in a hard error.
- Data Types: If an attribute is configured as numeric, non-numeric values will be skipped.
- HTML Content: Any values containing HTML tags will be skipped.
- Multi-value Attributes: As seen in the
sizeattribute example above, providing multiple<value>tags assigns an array of values to that single attribute (the item is available in bothXLandL). - ID matching: the
<id>tag can match a Tweakwise item id or any other attribute likeEANorSKU. If the identifier cannot be found during the import process, the attributes will be ignored. - Apply CDATA sections to all fields containing text with special characters. For example, image and url elements usually contain characters like &. Without CDATA those characters will be encoded, which in turn might result in some unwanted side-effects.
FAQ
Where do I use this XML feed?
Create an import task, make sure you choose Import multiple external attributes as type and run the import on your desired schedule.
How do I create this feed in Channable?
Follow the guide Create an external attribute feed using Channable to set up the channel.
Updated about 7 hours ago