how to store web activity result in a variable?

Jitender Singh 1 Reputation point
2022-11-15T10:46:48.553+00:00

Hi

i have a web activity through which i am executing a rest API(execute queries)
this is a sample output of that:

{

"results": [  
    {  
        "tables": [  
            {  
                "rows": [  
                    {  
                        "[Value]": "2022-10-25T00:00:00Z"  
                    }  
                ]  
            }  
        ]  
    }  
]  

i want to store the date value inside [Value] in a variable in adf (variable value should be:2022-10-25T00:00:00Z)
but i am not able to do that because of square brackets
this is what i have tried
"@activity('SQl validation').output.results[0].tables[0].rows[0].[value]"
but it give me error

please suggest how i can fix this

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

2 answers

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,546 Reputation points Microsoft Employee Moderator
    2022-11-16T08:51:11.837+00:00

    Hi @Jitender Singh ,

    Whenever we get a need to write expression which gets data from output of other activities then firstly you should look at the output json of activity and spot which property exactly holds your required information and then write expression accordingly. If that property holds array type data then you should use indexes to access items in it. Indexes starts with 0.

    I would encourage you to watch my below video, where I explained same thing in detail with example.
    How to read JSON output of one Activity in to another Activity in Azure Data Factory

    Hope this helps all other community members too and glad that your issue resolved.

    ----------

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

    1 person found this answer helpful.

  2. Jitender Singh 1 Reputation point
    2022-11-15T12:22:48.363+00:00

    By googling and searching i finally found my answer

    @activity('SQl validation').output.results[0].tables[0].rows[0]['[value]']

    0 comments No comments

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.