Forum Discussion

Rafaela07's avatar
Rafaela07
Helper I
6 months ago
Solved

Add New Column with Dynamic content in Copy Activity

Hi everyone! I'm facing a challenge in a copy activity of my pipeline. Context: I have a pipeline that makes api calls. The apis use something like the following format /api/emails/{email_id)/...
  • Thomaslleblanc's avatar
    6 months ago
    The cleanest way to “carry” the email_id into the sink is to add it as an extra source column in the Copy activity (inside the ForEach) so it flows through mapping alongside the API payload.
     
    one way to do it:

    1. Edit your REST dataset and add a parameter, e.g. EmailId (string).
    2. In the Copy activity (inside ForEach), pass the item into the dataset:
      • Dataset parameter EmailId = Item().email_id
    3. In Source → Additional columns:
      • Name: email_id
      • Value: @dataset().EmailId

    This avoids using item() directly in the Additional columns and can be easier to maintain.