Skip to main content
Unanswered

Data import with lookup to related CSV and Dataverse

editSubscribe (0) ShareShare
ReportReport
Posted on by

I am trying to create a data map to allow me to import data for 2 related entities.

The entities I have are a parent "Schedule" entity with records that reference multiple child "Schedule Item" entity records.

The import will consist of 2 csv files zipped together, Schedule.csv and ScheduleItem.csv.

The ScheduleItem.csv includes a column called Shedule that needs to be used to reference the parent Schedule.  This parent may be either defined in the associated Schedule.csv file (for new schedules) or already exist in the dataverse (for existing schedules).

For parents defined in Schedule.csv, the column that needs to be matched in the Schedule.csv is called ScheduleTitle.

For parents that exist in the dataverse, the dataverse column that needs to be matched is called dcs_name and the entity is called dcs_schedule.

If I add the following lookup to the map then Schedule Items that have a parent entry in Schedule.csv are matched as expected but ones with parent schedules that already exist in the dataverse aren't (they error with "The lookup reference could not be resolved", also as expected).

    Schedule
    new_schedulenumber
    Process
    
        
            Source
            Schedule
            ScheduleTitle
            Process
        
    

If I instead add the following lookup to the map then this is reversed i.e. ScheduleItems with parent Schedules already in the dataverse will be matched and imported but those with parents listed as new schedules in Schedule.csv won't be an will error with "The lookup reference could not be resolved" (as expected).

    Schedule
    new_schedulenumber
    Process
    
        
            System
            new_schedule
            new_name
            Process
        
    

If I then add both options...

    Schedule
    new_schedulenumber
    Process
    
        
            System
            new_schedule
            new_name
            Process
        
        
            Source
            Schedule
            ScheduleTitle
            Process
        
    

I still only get the ScheduleItems with parents already existing in the dataverse importing.  The items with parents specified in Schedule.csv continue to fail with "The lookup reference could not be resolved".  This is despite the fact that these will import correctly if I delete the LookupType>System</LookupType> map from that block.

What do I need to do to get both of these working together?

Thanks

Alan