How to get array element from web activity output with out using foreach loop?

Shekar 1 Reputation point
2022-07-06T10:32:08.513+00:00

i want get one element from web activity output. please find my json out put.

[
{
"conflationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"mainConflationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
{
"conflationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"mainConflationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
]

i need value of mainconflationid i wrote this expression but its not working..@activity('Get Conflation MainID').output[0].mainConflationId

please give solution,,,thanks in advance

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

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,401 Reputation points Microsoft Employee
    2022-07-22T09:27:54.627+00:00

    Hi @Shekar ,

    Thank you for posting query in Microsoft Q&A Platform.

    In your question, you missed to share full output json. Hence diffcult to help with exact expression. But still lets assume your array is inside abcd key may be. Then in this case below is the expression to write to access first item value of mainConflationId.

    @activity('Get Conflation MainID').output.abcd[0].mainConflationId

    Please feel free to share full output json to help you better.

    Kindly check below video that helps to understand how to write expression while trying to read output json of activity.
    How to read JSON output of one Activity into another Activity in Azure Data Factory

    Hope this helps. Please let us know if any further queries.f

    -------------

    Please consider hitting Accept Answer button. Accepted answers help community as well.