none
DataFactory v2 loading CRM - How to autoset GUID?

    Question

  • Hi,

    I am trying to load some contacts from a text file to Dynamics CRM 365 using Data Factory v2, however I receive an error as below, which I think is related to the value for ContactId GUID in CRM not being set (is not in my input file).  I was assuming that CRM would autoset the GUID for each records as it is inserted same way the UI does.  Anyone know how I can get DataFactory or CRM to autoset the GUID when loading new data?

    { "errorCode": "2200", "message": "Failure happened on 'Sink' side. ErrorCode=UserErrorMissingValidKey,

    ''Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,

    Message=Input DataSet must contain keycolumn(s) in Upsert/Update scenario. Missing key column(s): contactid,

    Source=Microsoft.DataTransfer.ClientLibrary.DynamicsPlugin,

    "failureType": "UserError", "target": "CopytoDynamics" }


    • Edited by sp_harris Thursday, May 24, 2018 10:52 AM spelling
    Thursday, May 24, 2018 10:49 AM

Answers

  • Hi,

    This is a guess on my part, but could you test out adding the contactid column to the text file you are importing with the values set as NULL?  Then in your Copy Activity sink properties, set:

    "ignoreNullValues": true

    I'm hoping Dynamics will ignore the NULL and replace with an autoset GUID.

    Thursday, May 24, 2018 8:29 PM
    Moderator

All replies

  • Hi,

    This is a guess on my part, but could you test out adding the contactid column to the text file you are importing with the values set as NULL?  Then in your Copy Activity sink properties, set:

    "ignoreNullValues": true

    I'm hoping Dynamics will ignore the NULL and replace with an autoset GUID.

    Thursday, May 24, 2018 8:29 PM
    Moderator
  • Hi,

    Excellent - that worked, thank you.

    In my text file I left the first field empty for the contact Id - just had a comma as I was using a CSV.

    I then added the field contact Id to my Azure Blob dataset as first in list,

    then added Contact Id into the Dynamics 365 Dataset,

    I then ticked to ignore NULL values in the Sink area of my copy job.

    I guess this is a 'feature' of data factory that if you don't have the primary key or id in your mapping you get an error, you need to ensure the primary key field is in the mapping, but not in the input data.

    Regards, Simon.

    Friday, May 25, 2018 10:16 AM