Home > Software design >  Azure Data Factory Selecting one item from object
Azure Data Factory Selecting one item from object

Time:09-14

How do you select just one item for an object in an object via Select in Azure Data Factory

{
  "CorrelationId": 123,
  "ComponentInfo": {
    "ComponentId": "1",
    "ComponentName": "testC"
  }
}

I have a join1 step in my ADF as such and Inspect and see results in that step: enter image description here

But when I select just the two I need the Data Preview errors out:

Column source1@ComponentInfo not found. The stream is either not connected or column is unavailable

The Select is set as such: enter image description here

source1@{source1@ComponentInfo}.ComponentName

What is wrong with my selecting ComponentName since it is an object - the selected method was selected from a drop down. I have tried to flatten the data but it is not an array and modify the schema but not sure if I am researching the right select object method.

CodePudding user response:

I reproduced this with above sample data and used select transformation after join. I got the same error as above.

enter image description here

Here, the select may looking the source1@ComponentInfo as column which is an object in this case.

You can get the desired result using derived column transformation.

After join, use derived column and create two new columns for the required columns and give like below in the data flow expression from the input schema.

enter image description here

ComponentName column:

enter image description here

CorrelationId column:

enter image description here

You can see the result in the Data preview.

enter image description here

Then, you can filter the required columns using select transformation.

enter image description here

Result:

enter image description here

  • Related