Python account
Python account

Reputation: 437

Expression of type: 'Int' does not match the field: 'value'

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

Answers (1)

Rakesh Govindula
Rakesh Govindula

Reputation: 11529

The @length() function returns integer value. But the variables in data factory only supports String, Boolean, Array.

enter image description here

That's why it is showing error like that.

enter image description here

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.



enter image description here

When you want use this value, just convert it to int at the time of usage with int().

Upvotes: 2

Related Questions