Context :
- Inside Azure Data Factory, I have a pipeline which contains a "Foreach" activity.
- I'm trying to write an expression for its "Items" setting.
In the expression builder, I have entered this :
@if(not(empty(activity('GetReplies').output.resultSets)), activity('GetReplies').output.resultSets[0].rows, array([]))
To make it more readable for you, I'm breaking it into several lines here (but not in the expression builder) :
@if(
//condition
not(empty(activity('GetReplies').output.resultSets)),
//true
activity('GetReplies').output.resultSets[0].rows,
//false
array([])
)
Note: The idea is to check if activity "GetReplies" produced a set of items. If yes, return it. If not, return an empty array.
There is no error highlighted in the expression builder. The pipeline gets saved, validated, published.
Problem : When I run the pipeline, I get an error "Unable to parse" on this expression.
Troubleshooting : I've tried with the simplest possible expression I could find to generate a set of items :
@array([])
...It still complains that the expression can't be parsed... (same error message)
What's the issue there???