Being Real
Being Real

Reputation: 83

Issue while reading a JSON script array output using Foreach loop in ADF

I have an array output from ACTIVITY script like this

Input json array
  {
  "result":[
  {
  "Val":[
  {"pqr":1,"srt":2},
  {"pqr":1,"srt":2}
  ]
  }
  ]
  }

How can I iterate this nested json object using a Foreach loop. I am getting error while I use @activity(script).output .result. Val to get the array values. Error: The length cannot be evaluated because property value doesn't exist

Upvotes: 1

Views: 987

Answers (1)

wBob
wBob

Reputation: 14379

Set your For Each activity Items to:

@activity('Script').output.result[0].Val

and use it within the activity using the @item() syntax, e.g.

@string(item().pqr)

Upvotes: 2

Related Questions