ADF : check on null values in array

Poel van der, RE (Ron) 451 Reputation points
2021-09-23T17:05:26.627+00:00

Hi

we have an incoming array called STG_LogicalKey in our ADF data flow.
In a filter activity we want to filter out those rows in the array where one, or all of the elements contain a NULL value

As filter condition we are using:
not(isNull(byNames($STG_LogicalKey)))

This works if the array contains one element.
But if the array contains 2 or 3 elements , we get an error saying: "function doesn't support 2 (or 3) arguments"

What is the expression to check if the array contains an element with a NULL value?
What is the expression to check if all the elements of the array contain a NULL value?

Regards
Ron

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,625 questions
0 comments No comments
{count} votes

Accepted answer
  1. MarkKromer-MSFT 5,226 Reputation points Microsoft Employee Moderator
    2021-09-24T20:10:36.937+00:00

    You should look at array functions for this in the expression guide: https://learn.microsoft.com/en-us/azure/data-factory/data-flow-expression-functions#array-functions

    Something like this is what you'll use: filter(array,!isNull(#item))

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Poel van der, RE (Ron) 451 Reputation points
    2021-09-27T06:48:36.79+00:00

    thnx @MarkKromer-MSFT

    we used iif(contains(array(byNames($STG_LogicalKey)),isNull(#item)),'Y','N'), but your proposal works as well

    thnx


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.