In the Azure Data Factory data mapping flow, is there a way to check if a column Date exists in the input file? If true, select the Date column, if not then create a Date column but leave the column blank in the output?
I tried with conditional select that if name=='Date', name the column as Date, but it the workflow fail with the "Date" column doesn't exist.
You can use
byName()in the derived column transformation.This is my sample input data with
Datecolumn.In derived column, use the below dataflow expression.
The above
byName()will search for the given column name and if it is there in the columns list then it gives those values and if it not there it will give null values to the column.Result when Date column present in source:
Source without
Datecolumn:Result with
Datecolumn and values asNULL:After derived column transformation, use select transformation to select your desired columns.