Reputation: 437
I'm trying to get a variable to get the length of an array with the following,
@length(activity('My JSON Array').output)
But getting the error,
Expression of type: 'Int' does not match the field: 'value'
Upvotes: 1
Views: 6944
Reputation: 11529
The @length()
function returns integer value. But the variables in data factory only supports String, Boolean, Array.
That's why it is showing error like that.
So, to store length of the array in a variable in ADF, first convert it to string.
@string(length(activity('JSON array').output.value))
Here my output array comes from a lookup. That's why I have used .value
.
When you want use this value, just convert it to int at the time of usage with int()
.
Upvotes: 2