Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Graham Carr 277 posts 389 karma points
    Oct 20, 2015 @ 10:27
    Graham Carr
    0

    Category association

    Hello,

    I am trying to map products to categories during an import. Each product in the EXCEL file has five category columns and I want to place the category id in this column to match on as I cannot use name as this might be duplicated across the categories.

    The categories have also been imported using CMSImport so the category ID that I have placed in the category columns for the products match the category IDs in the category EXCEL sheet.

    When I run the import however the categories are not being matched even though the correct location within Umbraco has been chosen.

    As an example I can see the following in the CMSImportRelation table:

    Excel fileProduct Category IDBEA - RCH Excel fileProduct Category IDBEA - AIR Excel fileProduct Category IDBEA - MAG Excel fileProduct Category IDBEA - PER Excel fileProduct Category IDBEA - POL Excel fileProduct Category IDBEA - COM Excel fileProduct Category IDBEA - DUR Excel fileProduct Category IDBEA - HAS Excel fileProduct Category IDBEA - ECB Excel fileProduct Category IDBEA - HDB Excel fileProduct Category IDLBR - MLB Excel fileProduct Category IDLBR - FSB Excel fileProduct Category IDLBR - DCB Excel fileProduct Category IDDIW - SMD Excel fileProduct Category IDDIW - CVW Excel fileProduct Category IDDIW - WAW Excel fileProduct Category IDSPA - MSP

    So within the product EXCEL sheet, for a random product example I have the following:

    Category 1 - BEA - RCH Category 2 - BEA - ECB

    I know that CMSImport does a match on ID and Node Name so are you able to tell me why this might not be working?

    Thanks,

    Graham

  • Richard Soeteman 4049 posts 12922 karma points MVP 2x
    Oct 21, 2015 @ 05:43
    Richard Soeteman
    0

    Hi Graham,

    You need to select the id as primary key. CMSImport Only maps on id not on nodename. Then you need to select the foreign key for products as well to import the products in the correct categories.

    Hope this helps,

    Richard

  • Graham Carr 277 posts 389 karma points
    Oct 21, 2015 @ 07:04
    Graham Carr
    0

    Hi Richard,

    I do not have products sitting under categories as a product can actually exist in multiple categories. What I actually have is a separate Product categories folder with sub-categories, then on a Product document type I have five content pickers.

    The category import is a separate import and EXCEL sheet to the product import.

    Within the EXCEL sheet for products I have five category columns and I have placed into this the ID's that were used within the category import and were selected as the primary ID (e.g. from the above are ID's such as BEA - AIR, BEA - MAG, etc.). When I run the product import however it does not seem to find the category ID's, but if I use the category name (e.g. Beacons) then they are found and matched correctly.

    Where am I going wrong?

    Thanks,

    Graham

  • Graham Carr 277 posts 389 karma points
    Oct 21, 2015 @ 07:15
    Graham Carr
    0

    Hi Richard,

    Have sent some example files along with supplemental information to your email address to try and highlight the issue better.

    Thanks,

    Graham

  • Richard Soeteman 4049 posts 12922 karma points MVP 2x
    Oct 21, 2015 @ 07:37
    Richard Soeteman
    0

    Ah you mean you use pickers? Yes then you need to use names, not id's. One gotcha when using pickers. It uses the first found relation (Not even using CMSImport relation). And easiest when you not use xpath in the picker.

    If you want full control over matching on the pickers it might be easier to write your own FieldProvider then CMSImport will use that instead of the default one.

    Best,

    Richard

Please Sign in or register to post replies

Write your reply to:

Draft