2

I have a Copy Activity in my ADF Pipeline which copies an excel worksheet data to a JSON sink. I am looking for a way to add a custom column that can keep a track of the row number while copying the data. For example,

Name Value
ABC 123
DEF 456
GHI 789

The above should be converted into the below JSON:

[{
   "Name": "ABC",
   "Value": "123",
   "Row Number": 1
},
{
   "Name": "DEF",
   "Value": "456",
   "Row Number": 2
},
{
   "Name": "GHI",
   "Value": "789",
   "Row Number": 3
}]

2 Answers 2

3

Unfortunately Copy activity is not suited for this requirement. You will have to use Mapping data flow in ADF.

Here are the sequence of transformations that are required to achieve your scenario:

  1. First Source transformation
  2. Derived Column transformation
  3. Window Transformation
  4. Sink Transformation

This has been answered in Microsoft Q&A forum with step by step implementation using Mapping dataflow : https://learn.microsoft.com/answers/questions/419209/index.html

Sign up to request clarification or add additional context in comments.

Comments

1

you probably need to use mapping data flow in ADF, and use the rowNumber() expression to achieve this.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.