EndpointManager
EndpointManager copied to clipboard
Lenovo Device Health workbook doesn't account for multiple batteries
In the Lenovo Device Health workbook, Line 2 of the query for the Battery Health widgets are:
| where BatteryHealth_s == 'Green' or BatteryHealth_s == 'Red'
However for devices like the T580 where there are two batteries, the BatteryHealth_s field is JSON, so in order to return any results, the line had to be changed to:
| where parse_json(BatteryHealth_s)[0] == "Green" or parse_json(BatteryHealth_s)[0] == "Red" or parse_json(BatteryHealth_s)[1] == "Green" or parse_json(BatteryHealth_s)[1] == "Red" or BatteryHealth_s == 'Green' or BatteryHealth_s == 'Red'
The rest of the queries had to be updated similarly. I'm not sure if that's the best solution, as I'm fairly new to KQL, but it seems to be working now.