Import and export traits
On this page
When you need to link many products to their trait values (for example after a migration, or when a new range arrives) you can do this via CSV.
The workflow is:
- Export a spreadsheet of your traits.
- Add or change the products each value applies to.
- Import the spreadsheet to apply the changes in bulk.
We recommend that you build your trait categories, types, and values first (see Trait Builder). Import only links existing products to existing values; it does not create new traits.
Export trait definitions or trait values
Open the StoreConnect Console and go to Inventory > Traits > Manage traits. There are two export options:
- Export definition IDs — in the Trait definitions pane on the left, behind the chevron beside Add definition. It lists your trait categories, types, and values, with the record Ids you need to reference each one. Start from this file when you are assigning values that are not on your products yet: each row you import creates a new assignment.
- Export traits — in the Products with traits pane on the right, behind the chevron beside Assign traits. It lists the trait values already assigned to your products. Export it to review or back up what is in place today, or to change those assignments: the file carries each assignment’s record Id, so its rows update in place rather than creating duplicates.
An export of 10,000 rows or fewer downloads straight away. Anything larger is prepared in the background and saved to the Files tab.
Filling in the spreadsheet
Assign values for the first time
Each row of the definitions export represents one Trait Value, with its category, type, and value names alongside the record Ids that identify it. There is no product column, so add one headed Product and enter the product’s record Id or its slug on each row you want to assign.
To assign the same value to several products, repeat the row and put a different product on each one, one product per row. A single import file can carry many values across many products.
Required columns
Only two columns are required, and a file missing either one is rejected when you upload it:
Product— the product’s record Id or its slug. In the Export traits file this column is nameds_c__Product_Id__cinstead. Either name works.s_c__Trait_Value_Id__c— the trait value’s record Id.
The name columns are just for your reference; the import does not read them. The category and type Id columns have no effect either, because the import fills those in from the trait value automatically. The only other columns that change what is imported are Id and s_c__Description__c, found only in the Export traits file and covered below. You do not have to start from an export at all: a two-column file works just as well, and the sample file you can download from the import screen is exactly that.
Revising assignments you already have
The Export traits file is ready to import back in as it is: edit the rows you want to change and upload the same file. It has two columns:
Id— the assignment’s own record Id, which is what makes a row update rather than create. Leave it in place on any row you are editing. Clearing it does not turn the row into a new assignment; the product and value are still paired, so the row is skipped as a duplicate.s_c__Description__c— a free-text Description for the individual assignment. The import only updates it when you enter something, so leaving the column blank never erases a description that is already there.
As long as a row keeps its Id, you can move that assignment to a different product or trait value, or add a description, just by editing the row and importing the file back.
:::tip If you only need the Id of one or two values rather than a whole export, use Copy lineage IDs in the Trait Builder to copy a value’s Ids straight to your clipboard. :::
Size limits
An import file must be a CSV, 1 MB or smaller, and contain no more than 10,000 rows. Larger files are rejected when you upload them. If you are migrating a big catalog, split the work into several files and import them one after another.
Importing
Go to Inventory > Manage traits, and select Import traits in the Products with traits pane, then:
- Download the sample file from the footer of the import screen if you need the correct column layout to start from.
- Add your product references to the spreadsheet, as above.
- Upload the file. Before it runs, you see a review of what will happen: how many rows across how many products.
- Run the import. The assignments are created in the background.
A row that would duplicate an existing assignment is skipped and reported in the success file as duplicate. Re-importing a partly edited export is safe because untouched rows carry their own record Id and resave unchanged.
When the import finishes, a success file and, if needed, an error file appear in the Files tab, named sc_trait_import_results_success and sc_trait_import_results_error with a timestamp. The error file lists any rows that could not be matched or saved, with the reason for each, so you can correct and re-import that file directly.
:::warning Import only matches products and trait values that already exist: products by their Id or slug, and trait values by their record Id. It never creates new categories, types, or values, and it never creates new products. Anything it cannot match is reported in the error file rather than created. This is deliberate: it keeps typos out of your trait catalog. Build the catalog in the Trait Builder first. :::
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.