Hi I am new to Azure ADF and trying to copy additional column values to a table. While doing so sometimes I am getting NULL values from source but while adding that to destination table I get following error.
ErrorCode=TypeConversionFailure,Exception occurred when converting value ” for column name ‘clearingHouseContactTelephoneNumber’ from type ‘String’ (precision:, scale:) to type ‘Decimal’ (precision:10, scale:0). Additional info: The input wasn’t in a correct format.
I want to make sure if there is an empty field then I need to simply add NULL value to that field. However ‘NULL’ keyword is not acceptable in dynamic content. Please take a look at this example screenshot. example image
Please help me with adding NULL value to the table.
2
Answers
You can use coalesce function and pass your dynamic value as first parameter and null as second parameter, this function will return the first not null value.
Using NULL in Azure ADF Dynamic content
Using NULL in Azure ADF Dynamic content
I tried to reproduce the error with similar dynamic content in copy activity and got similar error.
The reason of this error is the conversion of the string data type to decimal datatype.
The workaround is to using
DataFlow
: If your data flow contains numerous data fields, you must create new columns or modify current ones using the derived column transformation.For more details, refer Derived column transformation in mapping data flow.
You can even refer to this Microsoft Q&A post for more insights: Copy Task failure because of conversion failure
follow below steps: