Skip to main content

Notifications

Dynamics 365 general forum
Suggested answer

Need help figuring out how to populate a lookup field on import (OOTB)

Posted on by 5

Hi,

I'm taking over a solution built by a consultant have looked through all the documentation they left, but could not figure out one final piece.   We have a custom entity called Patient Outreach Program that has a N:1 relationship to the contact entity.  We do outreaches to our patients for specific programs (annual wellness, colonoscopy screening, etc).  My task was to create a new program for diabetes and I have set up everything like the previous programs as far as I can tell, except for one thing that isn't working.

When we import new records into this Patient Outreach Program entity for programs created by the consultant, the lookup field in the contact entity gets automatically populated to point to the related record in the Patient Outreach Program entity.  But for the new program I created for Diabetes outreach, the Patient Outreach Program records are created but the lookup field in the contact entity is not being populated.  I thought maybe the consultant created a workflow to do this, but there is none.  I also thought maybe Dynamics would do this automatically but it doesn't seem to be doing that either.

Currently at a loss and hoping others here have suggestions for how a lookup field can be populated on the "1" side of a N:1 relationship automatically when importing records into the "N" side.

  • Suggested answer
    srichard1234 Profile Picture
    srichard1234 5 on at
    RE: Need help figuring out how to populate a lookup field on import (OOTB)

    You're absolutely correct! This is a bonkers way to go about it. I think the consultant put a lookup in the contact entity to the custom entity because it's easier to display that in the UI of the form.  But it doesn't really make sense.

    I'll re-do my power automate flows to pull from the patient outreach program instead of the contact and use it's lookup field to pull in the contact entity properties.  I'll try filter the entity based on Program Name instead of ID otherwise I'll have to have a different ID between sandbox vs production environments.

    Thanks for the reply to help me re-think what I'm trying to do as bad design. I still don't know how the consultant populated the lookup field in the contact entity, but it doens't matter. I'm going to use the lookup field in the custom entity instead and just forget about the lookup field in the contact entity.

  • srichard1234 Profile Picture
    srichard1234 5 on at
    RE: Need help figuring out how to populate a lookup field on import (OOTB)

    Thanks for the suggestion. We're not using the OOTB import from Excel.  we're using Kingswaysoft in SSIS packages to populate CRM Dynamics from our Cerner EHR.  But after more thought, I think I'm going about this entirely the wrong way and I think the way the consultant did this is bonkers! I'm going to redo my data flows to pull from the custom entity which has the lookup to the contact and not the other way around.   Just makes more logical sense to me.

  • Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    RE: Need help figuring out how to populate a lookup field on import (OOTB)

    Hi srichard1234,

    Where is the lookup field that needs to be populated located? on the trial entity?

    Based on the relationship(a custom entity called Patient Outreach Program that has a N:1 relationship to the contact entity) you mentioned, it should be on the custom entity.

    If so, you can add lookup column to the file that you need import, then map it to contact entity.

    pastedimage1683177708276v1.png

    https://coderscollection.wordpress.com/2018/03/15/setting-data-management-data-maps-data-import/ 

    However, you also mentioned that the lookup field in the contact entity is not being populated.

    So I'm confused, can you share a screenshot to help me understand?

  • Suggested answer
    Mohamed Irfan Profile Picture
    Mohamed Irfan 90 on at
    RE: Need help figuring out how to populate a lookup field on import (OOTB)

    Hi,

    Did you check whether the mapping was done for that lookup field?

    You can go through this blog for the import steps - OOTB Import

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,867 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,173 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans