filter(myArray, !isNull(#item))
Data flow How to remove Null values from sink Json
We are using data flow to transform data from CSV to JSON and want to remove null values from an array before writing to a JSON file. All other results that have null values are automatically removed but it seems the null values remain a part of the array. We are pulling three columns into an array, is there a way to remove null values so they are not included in the JSON file.
[case ( length(replace(replace(replace((split(textbox38,':')[2]),'(',''),')',''),'-','')) > 5,
@(Type='Mobile',Number=(trim(replace(replace(replace((split(textbox38,':')[2]),'(',''),')',''),'-',''))))
),
case ( length(replace(replace(replace((split(textbox255,':')[2]),'(',''),')',''),'-','')) > 5,
@(Type='Home',Number=(trim(replace(replace(replace((split(textbox255,':')[2]),'(',''),')',''),'-','')))) ),
case ( length(replace(replace(replace((split(textbox256,':')[2]),'(',''),')',''),'-','')) > 5,
@( Type='Work',Number=trim(replace(replace(replace((split(textbox256,':')[2]),'(',''),')',''),'-',''))) )
]
Data Preview: (this is what is also written to the file, we want the null value removed from the file)
[["Mobile","3334701112"],["Home","4044771234"],null]
Azure Data Factory
1 answer
Sort by: Most helpful
-
MarkKromer-MSFT 5,226 Reputation points Microsoft Employee Moderator
2021-10-18T22:35:10.527+00:00