Forum Discussion
JVos
Helper IV
7 years agoInsert empty row without explicitly specifying column names
For adding one empty row to the "Sorted rows" intermediate result I have the following code: Table.InsertRows(#"Sorted Rows", 0, {[RoutingCropGroupCode = "", RouteName = "", LineNumber = "", Perc...
- 7 years ago
Also this one.
This uses your Table.InsertRows method
= Table.InsertRows(#"Sorted Rows", 0,{Record.FromList(List.Repeat({""},Table.ColumnCount(#"Sorted Rows")),Table.ColumnNames(#"Sorted Rows"))})
Syndicate_Admin
Administrator
2 years agoChatGPT told me to use this. It is simple and it works.
Table.Combine( { Table.FromRecords( { [ ] } ), NormalTable } )
Expression "Table.FromRecords( { [ ] } )" will return table with 1 row and zero columns (!!!). After union, no new columns will be added to "NormalTable" because they don't exist, but one row will be added. That one row will be filled with nulls, as it is normal behavior for Table.Combine function. Super clever.