Azure Data Factory: additional column in copy data activity reuse column values in a function?

Bram Vanhautte 0 Reputation points
2025-03-12T19:02:33.76+00:00

I am struggling with an Azure Data Factory pipeline action which is a copy data.

I have an input CSV file which I need to copy over to a blob storage as a CSV file but one of the column's values must get URLEncoded.

Problem which I currently have is that I don't seem to have the option to add an additional column in my 'Copy Data'-activity sink where I can reference the column and manipulate the data. I can purely copy paste the data from that column but can't make any adjustments to it.

This is what I am trying to do which is not working:

User's image

When I just try to reference the column on its own, it does work:

User's image

How can I mix the 2 together so I can manipulate my input data?
I already checked it with a Data Flow but there is no URLEncoding function available there.

Thanks

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
{count} votes

1 answer

Sort by: Most helpful
  1. phemanth 15,755 Reputation points Microsoft External Staff Moderator
    2025-03-13T05:43:31.63+00:00

    @Bram Vanhautte

    It seems like you're trying to add an additional column in your Azure Data Factory (ADF) Copy Data activity and manipulate the data within that column. Unfortunately, the Copy Data activity doesn't directly support data transformation like URLEncoding. However, you can achieve this by using a combination of activities.

    First, use a Lookup activity to read the data from your CSV file. This will allow you to manipulate the data before copying it to the blob storage.

    User's image

    Although you mentioned that Data Flow doesn't have a URLEncoding function, you can use a custom expression to achieve this. You can create a custom function in Data Flow to encode the URL.

    In the Copy Data activity, you can add an additional column by using dynamic content. Here's how you can do it:

    • In the Source tab of the Copy Data activity, click on "Additional Columns" User's image
    • Add a new column and use an expression to reference the column you want to manipulate. For example, you can use @concat('encoded_', item().yourColumnName) to create a new column with the encoded value.
    • In the Mapping tab, map the new column to the appropriate column in your sink dataset. enter image description here

    please refer https://learn.microsoft.com/en-us/azure/data-factory/copy-activity-overview#add-additional-columns-during-copy

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

    0 comments No comments

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.