question

braxx avatar image
0 Votes"
braxx asked nasreen-akter commented

Extract array from Json output

I am struggling how to extract an array from Json output.

Json Output from my Lookup activity:

 {
     "count": 3,
     "value": [
         {
             "Prop_0": "6"
         },
         {
             "Prop_0": "7"
         },
         {
             "Prop_0": "8"
         }
     ],
     "effectiveIntegrationRuntime": "LinkedHostedIntegrationRuntime(HostedIntegrationRuntimeCDH01)",
     "billingReference": {
         "activityType": "PipelineActivity",
         "billableDuration": [
             {
                 "meterType": "SelfhostedIR",
                 "duration": 0.016666666666666666,
                 "unit": "Hours"
             }
         ]
     },
     "durationInQueue": {
         "integrationRuntimeQueue": 4
     }
 }

Array wchich I expect to be my output. I thougt of using SetVariable activity to achieve it:
[6,7,8]

How to create an expresion in Set Variable to get [6,7,8]?
This is what I tried but not working for me

 @activity('Get List of Retailers').output.value


The purpose of doing this is to pass the array from Variable to a copy activity. In a copy activity I have a source data set as REST, where I am connecting API to retrive data. API expects a parameter which is my array.

Here is how my pipeline looks like
87829-capture1.png




azure-data-factory
capture1.png (33.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

nasreen-akter avatar image
0 Votes"
nasreen-akter answered nasreen-akter commented

Hi @braxx,

Before the CopyActivity, you can have a ForLoop to loop through all the values from the LookupActivity and append to a variable. And finally use that variable as a parameter in the CopyActivity. Thanks!

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello

Do you mean inside ForEach I should have Append Variable? And then in a copy Activit refer directly to a variable?

0 Votes 0 ·

ok, got it working! :)
Thanks a lot

1 Vote 1 ·

Hi @braxx, sorry I missed the message. Glad you got it resolved. :)

0 Votes 0 ·