ADF: copy activity, ordinal mapping and Additional columns on source side.

eg0087 0 Reputation points
2025-02-14T14:20:13.86+00:00

Hi, I have a pipeline with a copy data activity.

I would like to do an ordinal mapping, the source has all the columns needed on the sink side but I also want to add 2 Additional columns on source side which have dynamic content.

User's image

something comes up while trying to do the mapping, specifically if the mapping is like this:

User's image

the error that comes up is:

Screenshot 2025-02-13 164936

so I tried to map like this:

Screenshot 2025-02-14 151255

But the error would be User's image

does anyone know how to solve this?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,490 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,271 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ganesh Gurram 4,335 Reputation points Microsoft Vendor
    2025-02-14T21:56:36.17+00:00

    Hi @eg0087

    To perform ordinal mapping in Azure Data Factory (ADF) while also adding additional columns with dynamic content, you need to ensure that the mapping configuration is correctly set up. Here are some steps and considerations that might help you resolve the issue:

    Ordinal Mapping -When using ordinal mapping, make sure that the columns in the source are correctly indexed. The ordinal mapping requires you to specify the column index starting from 1. If your source data does not have a header line, this is crucial.

    Adding Additional Columns - You can add additional columns during the copy activity by configuring the additionalColumns property in your copy activity source. Each additional column can have a dynamic value, which can be set using ADF expressions or reserved variables.

    User's image

    Mapping Configuration - After adding the additional columns, ensure that you map them correctly in the mapping tab. You may need to explicitly define how these additional columns relate to the sink schema.

    Error Handling - If you encounter errors during the mapping process, check the following:

    • Ensure that all required columns in the sink are being mapped correctly.
    • Verify that the additional columns do not conflict with existing column names in the sink.
    • Make sure that the data types of the additional columns are compatible with the sink schema.

    Testing - After making changes, run the pipeline to see if the issue persists. If errors continue, reviewing the error messages closely can provide insights into what might be going wrong.

    If you follow these guidelines and ensure that your mapping and additional columns are set up correctly, you should be able to resolve the issue.

    Reference documentations:

    Hope this helps. Do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


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.