Forum Discussion
ErrorCode = 10277, cannot convert null to logical - Dataflow Gen 2 - Lakehouse
- 1 year ago
In the end, I had to replace all null and 0 values in all columns (not just logical) and remove a date column that had null values that couldn't be replaced or filtered.
Hi eneri,
Thank you for reaching out to the Microsoft fabric community forum. I have identified few workarounds that may help resolve the issue. Please follow these steps:
Thanks for the detailed update. Based on your description and the error details (specifically: "Cannot convert the value null to type Logical", Error Code 10277), the issue is caused by a schema type mismatch between your transformed data and the Lakehouse table you're writing to.
When using aggregations and joins in Dataflow Gen2, certain columns especially ones expected to be of type Logical (Boolean) may end up containing null, blank, or inconsistent values after transformation. Even if these columns are handled in earlier steps, Dataflow Gen2 validates column types strictly at write time to the Lakehouse. If any logical column contains a null or value of a different type (e.g., string), the write will fail.
This is a known limitation in how Dataflow Gen2 works with Lakehouse schema enforcement. Boolean fields are especially sensitive, as the engine expects them to only contain true, false, or valid nullable Booleans.
Open the Dataflow and Navigate to the Data Destination Step: Edit your dataflow and proceed to the final step where the data is written to the Lakehouse.
Turn Off Use Automatic Settings: At the top of the destination settings, switch off “Use automatic settings” to manually configure the column mappings. Check Columns That Cause Issues: Identify any columns inferred as Logical type (e.g., has_other_markers, has_fji_only, fl_started_tf). In the column mapping table, change the "Destination type" of these columns to Text or Whole Number, depending on your storage preference. Using Text offers the most flexibility and avoids Boolean conversion issues.
Alternatively, if you expect only 1/0 or true/false values, map to Whole Number. Let the Dataflow Create or Overwrite the Table: If the destination table already exists in the Lakehouse, either delete it to allow the dataflow to create a new table with updated types, or confirm the column types in the existing Lakehouse table match the updated schema (e.g., Logical → Text).
Save and Rerun: After updating the column mapping, save the dataflow and rerun it. It should now complete successfully without the type conversion error.
Refer to the below link: What is a lakehouse? - Microsoft Fabric | Microsoft Learn
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.
In the end, I had to replace all null and 0 values in all columns (not just logical) and remove a date column that had null values that couldn't be replaced or filtered.