1

I get following result from my script task, How should I build expression to check if the result contains 'exceed'

{ "resultSetCount": 1, "recordsAffected": 0, "resultSets": [ { "rowCount": 2, "rows": [ { "status": "exceed" }, { "status": "pass" } ] } ],

Equator
  • 77
  • 8

1 Answers1

0

You could just the contains function in the Azure Data Factory expression language. In this example, I have used a parameter to hold the string value as I can't easily reproduce your script, but it should work for your example:

@contains(pipeline().parameters.pInput, 'exceed')

contains returns a boolean value so I am assigning it in a Set Variable activity just as an example:

My results

This is obviously a bit of a blunt instrument and using string methods rather than working with the json methods. If you wanted to, you could loop through each row with a For Each activity but it hardly seems worth it. Set the items of a For Each activity to something like this to loop through each row:

@json(pipeline().parameters.pInput).resultSets[0].rows
wBob
  • 13,710
  • 3
  • 20
  • 37