Append an array column in mapping data flow's derived column transformation in ADF

SARASWAT CHETAN 91 Reputation points

I have an existing array of multiple JSON objects coming out of a select transformation and I have to append all the objects within that array with some more "default" key-value" pairs(string type) using a derived column.

Could anyone suggest any possible way of doing these. I have tried using below to get all the items(json based objects) from the array, but not able to add more key-value pairs to each objects.


Note the four fields below "devicearray" are the one's which are to added to the array of objects.

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,059 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
7,180 questions
0 comments No comments
{count} votes

Accepted answer
  1. Kiran-MSFT 691 Reputation points Microsoft Employee

    map(userdevices.devices, @(
    each(#item, match(true), $$),
    createdtime = currentDate(),
    isActive = true

    If the UI does not validate this, instead of each(#item, match(true), $$), you have to specify every item

    deviceId = #item.deviceId,
    deviceName = #item.deviceName

2 additional answers

Sort by: Most helpful
  1. Kiran-MSFT 691 Reputation points Microsoft Employee

    You can just do arr1 + arr2 if there are of the same type

  2. Kiran-MSFT 691 Reputation points Microsoft Employee

    What does your DSL script look like(click on script button)?