Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Alternate key in Copy Activity for Dataverse expects bool

Hi All,

 

I am trying to create a pipeline where my source is file and i'm trying to upsert the data into dataverse. for that I want to pass the alternate key in dynamic format. But while passing the alternate key( which is actually a string and parameter of the pipeline) I am getting below error:

Expression of type: 'String' does not match the field: 'alternateKeyName'. Expected type is 'bool'.

Could any one help? How can alternate key be of type boolean? 

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, Anonymous 

     

    I briefly restored your question.

    After testing, you can try the following methods. Create a new parameter.

    No errors are reported at this time.

     

    For more information you can refer to the following documents.

    Expression and functions - Azure Data Factory & Azure Synapse | Microsoft Learn

    Configure Dataverse in a copy activity - Microsoft Fabric | Microsoft Learn

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Charlotte,

       

      Thank you for your reply.

      I understand that if I use a parameter of type boolean, no error will be shown.

      But alternate key has to be a string. Boolean can hold only true or false value. To be able to pass a proper key (example- ID, Name) I have to pass a string to this alternate key box.

       

      Can you please let me know why it expects a boolean exactly? 

  • I was having the same problem.  The answer suggested is no help at all.  The Alternate Key Name is a field where you provide the name of the key column - the column used as a key to perform a merge or upsert.  It has to be the name of one of the columns in the table.  I know that we can remove the error by putting a parameter with a value of True or False into it, but that will not tell the merge activity which column to use, resulting in an error when we run the pipeline.  

     

    I did note that when the error appeared, it was in yellow rather than red, so I saved the pipeline anyway (with the correct string in place of the required bool) and ran it and everything worked.  So this appears to be a display bug only.