Lookup Activity Array - filter

Kuldeep Chitrakar 1 Reputation point
2022-11-10T13:47:41.343+00:00

I have a lookup activity which returns array as I would like to set a variable in next activity if ParameterKey="Param1" the set variable value as ParameterValue.

Basically I would like to choose which value to set based on filter in , I am not sure how i can do that,

{
"count": 3,
"value": [
{
"ParameterKey": "Param1",
"ParameterValue": "Value1",
"IsActive": true,
},
{
"ParameterKey": "Param2",
"ParameterValue": "Value2",
"IsActive": true,
},
{
"ParameterKey": "Param3",
"ParameterValue": "Value3",
"IsActive": true,
}
]
}

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

1 answer

Sort by: Most helpful
  1. Anonymous
    2022-11-10T14:08:22.6+00:00

    You can use a Filter activity to get just the object with ParameterKey="Param1" with this expression, in my case I put your json in a variable so change that to be the output of your Lookkup

    @equals(item().ParameterKey, 'Param1' )

    Then you can get the ParameterValue with this expression, my Filter activity was called Filter1, change as necessary for your name

    @activity('Filter1').output.Value[0].ParameterValue

    0 comments No comments