Azure ADF Json Reading, Array elements can only be selected using an integer index

Vaibhav B 31 Reputation points
2022-06-20T10:29:23.747+00:00

Hi I have, following Output from one activity, i want to select DestCount and pass it to the variable. How can i write it.

I am writing, @activity('Script1').output.resultSets.rows[0]['DestCount']

What am i missing here, Can anyone tell?

Thanks.

212926-image.png

![212973-image.png]3

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,373 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,623 questions
0 comments No comments
{count} vote

3 answers

Sort by: Most helpful
  1. Nasreen Akter 10,811 Reputation points Volunteer Moderator
    2022-06-20T11:53:02.05+00:00

    Hi @Vaibhav B ,

    Would you please try: @activity('Script1').output.resultSets.rows[0].DestCount

    Thanks!


  2. Vaibhav B 31 Reputation points
    2022-06-20T14:09:43.48+00:00

    213023-image.png

    0 comments No comments

  3. ShaikMaheer-MSFT 38,546 Reputation points Microsoft Employee Moderator
    2022-06-27T03:48:24.117+00:00

    Hi @Vaibhav B ,

    Thanks for posting query in Microsoft Q&A Platform.

    Kindly consider writing expression as below to get value from highlighted DestCount property of output JSON.
    @activity('Script1').output.resultSets[0].rows[0].DestCount.

    Please check below video to understand how to pass or read values from output json of activity.
    https://www.youtube.com/watch?v=2XfUKWwDi3g

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

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

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


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.