How to append a string value in the column value in Copy Activity in ADF

Ankit Kumar 91 Reputation points
2021-07-16T11:19:48.55+00:00

In below copy activity screen shot , i am trying to create a new column(PartitionKey) whose value is same as DocType column. I would also like to insert one string value along with Doctype value. something like concat("recoding",$.Doctype) as value of PartitionKey. I am unable to do so and would like to know if this is possible to do.

I want this because I get error for some items where DocType key is not present. and I would like to avoid that.

The error message i get is below and I am not sure for which item this error occurs as there are thousands of items getting copied.

ErrorCode=DuplicateColumnNotFound,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=,Source=,''Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Column name '$.DocType' to be duplicated is not found in the source data. Please check the source column name

115403-image.png

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,663 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. KranthiPakala-MSFT 46,487 Reputation points Microsoft Employee
    2021-07-18T23:38:08.187+00:00

    Hi @Ankit Kumar ,

    Thanks for using this forum and posting your query.

    1. The reason for this error is because you are using an incorrect syntax $.DocType, it should be just the column name as DocType . This would avoid the error and copy the values of DocType column to your newly added column PartitionKey. 115647-image.png
    2. For the additional requirement of concatenating a string value to this additional column - I don't think this is possible within copy activity and Copy activity is not intended for this purpose. If you would to do a data transformation then I would recommend you to please use Mapping Data flow in ADF which is better suited for transformations. Here is a list of supported transformations by Mapping dataflow : Mapping data flow transformation overview
      You can use a Derived column transformation which would help to achieve your requirement.

    Hope this info helps. Do let us know if you have further query.

    ----------

    Please don’t forget to Accept Answer and Up-Vote wherever the information provided helps you, this can be beneficial to other community members.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.