Forum Discussion
If table is empty, insert null value, else carry on.
- Anonymous5 years ago
I figured it out.... the table name is the name of the previous step. I was calling it by a different name. It's always a small problem isn't it.... anyway thanks for your help!
The end of the code now reads:
#"Removed Other Columns3" = Table.SelectColumns(#"Renamed Columns2",{"BatchNo"}), #"Changed Type3" = Table.TransformColumnTypes(#"Removed Other Columns3",{{"BatchNo", type text}}), #"AddNull" = if Table.IsEmpty(#"Changed Type3") then Table.InsertRows(#"Changed Type3",0, { [BatchNo = "null"] }) else #"Changed Type3", #"Search Batch Number" = #"AddNull"{0}[BatchNo] in #"Search Batch Number"All I had to do was change Table.InsertRows(BatchNumber2, 0, { [BatchNo = "null"] }) to Table.InsertRows(#"Changed Type3", 0, { [BatchNo = "null"] }).
I figured it out.... the table name is the name of the previous step. I was calling it by a different name. It's always a small problem isn't it.... anyway thanks for your help!
The end of the code now reads:
#"Removed Other Columns3" = Table.SelectColumns(#"Renamed Columns2",{"BatchNo"}),
#"Changed Type3" = Table.TransformColumnTypes(#"Removed Other Columns3",{{"BatchNo", type text}}),
#"AddNull" = if Table.IsEmpty(#"Changed Type3") then Table.InsertRows(#"Changed Type3",0, { [BatchNo = "null"] }) else #"Changed Type3",
#"Search Batch Number" = #"AddNull"{0}[BatchNo]
in
#"Search Batch Number"
All I had to do was change Table.InsertRows(BatchNumber2, 0, { [BatchNo = "null"] }) to Table.InsertRows(#"Changed Type3", 0, { [BatchNo = "null"] }).
Glad you got it solved Anonymous