web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to map a lookup on multiple fields in Data Import Wizard

(0) ShareShare
ReportReport
Posted on by

I need to import a data set that contains a lookup field (e.g. column-A). However, the values in column-A are not always unique in CRM. As a result, I always got import error "A duplicate lookup reference was found". In this data set, there is no any single column that can be used as a unique reference for this lookup. However, there is a combination of two columns (e.g. column-A and column-B) that can uniquely determine the lookup reference.

My question is how to set up the lookup based on the combination of both column-A and column-B in data import wizard?

Thanks in advance!

Hao

*This post is locked for comments

I have the same question (0)
  • Royal King Profile Picture
    27,686 on at
    RE: How to map a lookup on multiple fields in Data Import Wizard

    You can use combination two field values to map the lookup value when you import the data in the crm system.

    When you are mapping the data in crm , all you have to do is,  click on the lookup mapping destination field where it will pop-up new window and will display all available fields of the lookup field where you choose which field you want to map to lookup entity record.

    Below post shows in details with screen shot for the same

    https://crm2013experience.wordpress.com/2014/02/05/crm-2013-importing-lookup-records/

  • Verified answer
    Aileen Gusni Profile Picture
    44,524 on at
    RE: How to map a lookup on multiple fields in Data Import Wizard

    Hi Hao,

    You can have multiple reference for the lookup field, that is finding based on the Column A first, then find the column B, but not the combination Column A - Column B like that to be unique.

    For example you have data:

    Account Data (existing Master Data for Account)

                Column A                                       Column B

    Company/Account Name                             Website

    ====================================

    ABC Corp                                                http://www.abc-corp.com

    ABC Corp                                                 http://www.abc-corp.co.uk

    XYZ                                                          http://www.xyz.com

    *As we can see you column A for ABC Corp is not unique, but if we combine with column B then it is unique, right.

    Now, you have this CSV:

    Contact Name                Company Name (Account lookup)               =======================================

    John Doe                                 ABC Corp                                        

    Adrian Sanchez                       ABC Corp  

    Daniel Edwards                       XYZ

    Then you import this using column A as the reference for Account.

    When you import, you will get failure in import for John Doe and Adrian Sanchez,

    excelimport2.png

     

    the reason is because  CRM cannot resolve the ABC Corp since there are two accounts with same Name = "ABC Corp", this single reference wont work for this.

     

    So, back to the dataset you have for Account reference..

                Column A                                       Column B

    Company/Account Name                             Website

    ====================================

    ABC Corp                                                http://www.abc-corp.com

    ABC Corp                                                http://www.abc-corp.co.uk

    XYZ                                                         http://www.xyz.com

     

    *As we can see you column A for ABC Corp is not unique, but if we combine with column B then it is unique, right.

    We cannot use column A as the single reference (we tried before and it was error), so we need another reference, we need the Website as the reference as well.....

    Important Note here!

    ---------------------------

    *In fact, you know that column B is a unique column (so you understand that you already have a unique column on it) , so in case you have a column B as the unique column, then you will be fine, then in your CSV, you replace the data from ABC Corp to its individual website data, here you go your new CSV data.

    Contact Name                Company Name (Account lookup)               =======================================

    John Doe                                 http://www.abc-corp.com                                        

    Adrian Sanchez                       http://www.abc-corp.co.uk 

    *We replace the Company Name value in the CSV file to the another unique field value, that is referring to Website

    And it should work now.

    Now let's map this column to multiple reference, Account Id, Account Name (by default already there), and add the Website

    excelimport3.png

     

    As you can see we map to the multiple reference.

    See this link as well about this multiple column reference

    leontribe.blogspot.com/.../changing-lookup-reference-when.html

     

    Here is the result..

    excelimport4.png

     

    Yeah, now it works..

    If that is your scenario, you have the 'combination' like that, if the column A column B concept you are referring to are much like that then you will be saved with this CRM 2011 and above new feature, while previous version didn't have that feature. You can use that combination.

     

    But, do you realize that this is because of the Website Name (column B) is unique?

    I don't know what is your scenario, is that like above described scenario (you have two columns, while you have alternative if column A is not unique, then you use column B)

    Or your scenario found that none of them are unique?

    Example here:

    Now, in fact you have this data not the previous one:

             Column A                                           Column B

    Company/Account Name                             Website

    ====================================

    ABC Corp                                         http://www.abc-corp.com

    ABC Corp                                         http://www.abc-corp.co.uk

    XYZ                                                  http://www.xyz.com

    ABC Corp (UK)                                http://www.abc-corp.co.uk

     

    As you can see ABC Corp values are not unique, neither are the website ID values: http://www.abc-corp.co.uk, right?

     

    In fact, the unique is the combination and concatenation between two fields, combined together the Name + Website, right.

    ABC Corp - http://www.abc-corp.com

    ABC Corp - http://www.abc-corp.co.uk

    ABC Corp (UK) - http://www.abc-corp.co.uk

    None of them are duplicate if you use that combination, right.

    They are unique, BUT in COMBINATION of two columns.

    There is no specific column for this dataset as the single unique ID in this case (except its GUID itself)

     

    Now you have this CSV (didn't change the last CSV you are using)

    Contact Name                Company Name (Account lookup)               =======================================

    John Doe                                 http://www.abc-corp.com                                        

    Adrian Sanchez                       http://www.abc-corp.co.uk 

     

    What will happen? Especially what will happen with Adrian Sanchez (I guess John Doe will be still in because in fact 'http://www.abc-corp.com' is unique, it's not a duplicate reference, right, no more than 1 account is using the http://www.abc-corp.com  as their website URL

    You cannot use ABC Corp as the Company Name not the website as well.

    Now here is the result after you do mapping to Account Name + Website in the import.

    excelimport5.png

     

    As per expected, 1 Success, 1 Failure, let's see the detail.

    2867.excelimport6.png

     

    Yeah, 1 Success is for ABC Corp, you are saved because of its website,   

    "http://www.abc-corp.com"     

    doesn't have any duplicate reference problem

    But, how about the failure?

                                             

    Yes, here as you can see the website you inputted is having a duplicate resolution problem.

    So, Hao, if your scenario is the first scenario as I mentioned at the first, you have website as the unique ID.

    The concept here is you can have multiple columns as many as you want for multiple reference, CRM will find the column reference from column A, column B, column C, etc (based on your mapping), but if in the end, it ends to column B or column C but still got duplicate value, then it wont work.

    Thus, If your data contains any, at least one column as reference but you are not sure which one, you can use the 'combination' multiple reference in the lookup mapping by ticking all of the possible columns, however, if your data master reference itself still not unique or the combination in term of concatenation multiple columns (e.g column A - column B), it wont work.

     

    Hope that make you more understand about this.

    Which one of your scenario? I gave explanation for those scenarios.

    Hope this helps.

    Thank you.

  • Community Member Profile Picture
    on at
    RE: How to map a lookup on multiple fields in Data Import Wizard

    Thanks Chitra,

    I read that article, but it won't solve my issue because in my data set I don't have any single column that can be used as a unique reference.

    Thanks,

    Hao

  • Verified answer
    Aileen Gusni Profile Picture
    44,524 on at
    RE: How to map a lookup on multiple fields in Data Import Wizard

    Hi Hao,

    So yes, it is not possible as per my explanation before.

    You need to use GUID as the only one unique column.

    Thank you.

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: How to map a lookup on multiple fields in Data Import Wizard

    Hi Aileen,

    Thank you very much for the explanation. It is very comprehensive and clear. I really appreciate it.

    My scenario is like the last one. The uniqueness for lookup relies on multiple references.

    I guess that I'll have to create a new field in CRM as the unique reference for importing data.

    Thanks again,

    Hao

  • Verified answer
    Aileen Gusni Profile Picture
    44,524 on at
    RE: How to map a lookup on multiple fields in Data Import Wizard

    Hi Hao,

    No problem.

    Yes, this is one of the limitation of its 'combination'

    you can use GUID..

    But little bit tricky...

    Export the reference dataset, for example in my case is Account...(don't forget to check the Re-import capability) in order to get Account ID.

    Then the difficult part here is how to do the mapping.

    You need to open at least two excel sheet, one is your CSV, one is the Master reference you downloaded from the previous step. And I guess you also need another new CSV as the new combination.

    Now you have two fields (the original CSV + Master reference)

    Now, you need to use VLOOKUP with multiple criteria or concatenation

    Example here:

    www.excel-university.com/vlookup-on-two-or-more-criteria-columns

    exceltactics.com/faster-multiple-criteria-lookups-vlookup-concatenate

    so here you can find the GUID of the Account based on this VLOOKUP.

    I know this is manual way..

    But, no choice for this method.

    Hope that helps you, Hao.

    Thanks.

  • Community Member Profile Picture
    on at
    RE: How to map a lookup on multiple fields in Data Import Wizard

    Thanks Aileen,

    This is very helpful.

    Hao

  • KATZH Profile Picture
    on at
    RE: How to map a lookup on multiple fields in Data Import Wizard

    Hi

    I have a similar problem. I have a lookup reference on "household" (custom entity) in my notes to be imported. My household exists 2 times: 1 inactive old record (to be kept) and an active record. I want to import the notes to my active households.

    I always get a duplicate error.

    How do I have to prepare my Notes Import Excelsheet / CSV / XML to reference on 2 values: The ID of the household AND the Status.

    My columns are Title / Description / ID / Status

    I cannot export the records to get the GUID. I have to import Notes REGARDING Household by using the ID and Status.

    regards

    Kaida

  • Suggested answer
    Abarika Profile Picture
    5 on at
    RE: How to map a lookup on multiple fields in Data Import Wizard

    This is just one of the limitations of the VLOOKKUP function

    Conventionally, it cannot work with two criteria. It cannot look into two columns and return a value based on those columns.

    However, there's a technique I use to get around this restriction - Using a helper column.

    • First, you create a new column in your table as your helper column.
    • Next, use the =CONCATENATE() function to join the two columns you want to use as lookup values. See screenshot:two-column-lookup2.png
    • Now use the helper column as your lookup column to perform the VLOOKUP
    • two-column-lookup2.png

  • Learn@mscrm Profile Picture
    50 on at
    RE: How to map a lookup on multiple fields in Data Import Wizard

    Hi Aileen,

    I'm facing similar issue. I have to import 5000+ records in my application. we are using Dynamics 365 online version.

    i have totally 4 entities and are related. I have to import one entity which has look up value. The look up values are same values and I'm getting duplicate reference error.

    four columns

    A B C D

    A: B = 1: N

    B: C  = 1 : N

    C:D = 1: N

    c values are many so when i import i have duplicate reference error,  but if i combine B and C it is unique.

    I created a combination field(single line of txt) in "C" entity

    I tried to map this combination field to look up entity, Im able to import D values but column C is blank.  Can you tell me how to import look up values(C) which should be related to B

    Column  Column

    D               C

    value 1      .......

    value 2      .......

    from checking related material i did following ways

    D          C           B               Combination (using excel formula and dragged it)

    D1          C1          B1             B1-C1

    D2          C1          B2             B2-C1

    D3          C1          B3              B3-C1

    D4          C1          B4              B4-C1

    D5          C1          B5              B5-C1                      

    D entity had two fields Name(text) and C value(look up)

    Can you please help mapping and let me know steps to do this import. let me know if you need any other details.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans