Forum Discussion
Heinrich
3 years agoPost Partisan
Show Text when No Data in a Table
Hello I have a Table-Visual which has "Tracking-Numbers". Sometimes there are no data then the table is empty. Is it possible to change the empty table with a table which has a remark "No Data". ...
- 3 years ago
Hi Juan
I am glad that it is finally working!
This code should work for you:
let Quelle = SharePoint.Tables("https://axa365.sharepoint.com/sites/AXA-MicrosoftTeamsService", [Implementation="2.0", ViewMode="All"]), #"5aaa8718-9d99-4675-9214-078e6e3131a7" = Quelle{[Id="5aaa8718-9d99-4675-9214-078e6e3131a7"]}[Items], #"Hinzugefügte benutzerdefinierte Spalte" = Table.AddColumn(#"5aaa8718-9d99-4675-9214-078e6e3131a7", "Custom_Summary_as_Text", each Html.Table([Summary],{{"PlainText",":root"}})), #"Erweiterte Custom_Summary_as_Text" = Table.ExpandTableColumn(#"Hinzugefügte benutzerdefinierte Spalte", "Custom_Summary_as_Text", {"PlainText"}, {"Custom_Summary_as_Text.PlainText"}), Custom1 = if Table.IsEmpty(#"Erweiterte Custom_Summary_as_Text") then Table.InsertRows(#"Erweiterte Custom_Summary_as_Text",0,{ [#"Tracking-Number" = "Table Is Empty",#"Escalated" = "False"]}) else #"Erweiterte Custom_Summary_as_Text" in Custom1Let me know if it does.
Regards
Hugh
Heinrich
3 years agoPost Partisan
Hello Hugh
Hope you are having a great time.
Yes this worked. Great thank you.
If I would like to change the source from Excel to SharePoint List would this work
Sourcecode
let
//Base64 string for table with data: "i45WCvE1VNJRckvMKU5Vio0FAA=="
//Base64 string for table without data: "i44FAA=="
Quelle = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i44FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Tracking-Number" = _t, Escalated = _t]),
#"Geänderter Typ" = Table.TransformColumnTypes(Quelle,{{"Tracking-Number", type text}, {"Escalated", type logical}}),
Custom1 = if Table.IsEmpty(#"Geänderter Typ") then Table.InsertRows(#"Geänderter Typ",0,{ [#"Tracking-Number" = "Table Is Empty",#"Escalated" = "False"]}) else #"Geänderter Typ"
in
Custom1
to
let
Quelle = SharePoint.Tables("https://axa365.sharepoint.com/sites/AXA-MicrosoftTeamsService", [Implementation="2.0", ViewMode="All"]),
#"5aaa8718-9d99-4675-9214-078e6e3131a7" = Quelle{[Id="5aaa8718-9d99-4675-9214-078e6e3131a7"]}[Items],
#"Hinzugefügte benutzerdefinierte Spalte" = Table.AddColumn(#"5aaa8718-9d99-4675-9214-078e6e3131a7", "Custom_Summary_as_Text", each Html.Table([Summary],{{"PlainText",":root"}})),
#"Erweiterte Custom_Summary_as_Text" = Table.ExpandTableColumn(#"Hinzugefügte benutzerdefinierte Spalte", "Custom_Summary_as_Text", {"PlainText"}, {"Custom_Summary_as_Text.PlainText"})
Custom1 = if Table.IsEmpty(#"Geänderter Typ") then Table.InsertRows(#"Geänderter Typ",0,{ [#"Tracking-Number" = "Table Is Empty",#"Escalated" = "False"]}) else #"Geänderter Typ"
in
#"Erweiterte Custom_Summary_as_Text"
Is this ok?
Thank you
Have a great day
Juan
HughLa
3 years agoResolver IV
Hi Juan
I am glad that it is finally working!
This code should work for you:
let
Quelle = SharePoint.Tables("https://axa365.sharepoint.com/sites/AXA-MicrosoftTeamsService", [Implementation="2.0", ViewMode="All"]),
#"5aaa8718-9d99-4675-9214-078e6e3131a7" = Quelle{[Id="5aaa8718-9d99-4675-9214-078e6e3131a7"]}[Items],
#"Hinzugefügte benutzerdefinierte Spalte" = Table.AddColumn(#"5aaa8718-9d99-4675-9214-078e6e3131a7", "Custom_Summary_as_Text", each Html.Table([Summary],{{"PlainText",":root"}})),
#"Erweiterte Custom_Summary_as_Text" = Table.ExpandTableColumn(#"Hinzugefügte benutzerdefinierte Spalte", "Custom_Summary_as_Text", {"PlainText"}, {"Custom_Summary_as_Text.PlainText"}),
Custom1 = if Table.IsEmpty(#"Erweiterte Custom_Summary_as_Text") then Table.InsertRows(#"Erweiterte Custom_Summary_as_Text",0,{ [#"Tracking-Number" = "Table Is Empty",#"Escalated" = "False"]}) else #"Erweiterte Custom_Summary_as_Text"
in
Custom1
Let me know if it does.
Regards
Hugh