Forum Discussion

ldoodle's avatar
ldoodle
Icon for Advisor rankAdvisor
4 months ago
Solved

Table style widget + values from PropertSource - possible?

Hi,

I’m just fiddling now but I had a thought about exposing at least Windows resources Windows Update info. The only way I’ve been able to do this is with an Alert style widget, but it doesn’t look brilliant (especially column names):

I have a custom PropertySource that retrieves that info.

What I would like to do is use the standard Table style widget instead, but that seems only possible to use a DataSource and not PropertySource. And then have the ‘Show colour bars’ option turned on and colourise the auto.os.latest_update.result_code and auto.os.latest_update.error_code columns when they meet certain criteria. Also, if the install date is over a 6 weeks ago then it’s likely to not have the latest update.

And then additionally, show any matching resources who have those 2 columns as specific values in the normal Alerts List widget, e.g. ‘Windows Update failed installation’ or ‘Windows Update succeeded with errors’ etc. etc.

Thanks

  • Having tables support property columns is a popular request. I suggest submitting that as feedback to LM. I’m not sure how color bars would work for properties since they are not numbers but perhaps there is a way to implement something close.

    As a workaround, perhaps you can create a “Info” DataSource that reports the version as a number. Like perhaps remove all the dots after the first one and do some zero padding (so 1.9.1 → 1.09001). Without the padding 1.10.2 (1.102) will come before 1.9.1 (1.91).

    There are also some forum posts you might find that do hacky tricks to use the API to generate HTML table code which can be displayed by the Text widget.

4 Replies

  • Having tables support property columns is a popular request. I suggest submitting that as feedback to LM. I’m not sure how color bars would work for properties since they are not numbers but perhaps there is a way to implement something close.

    As a workaround, perhaps you can create a “Info” DataSource that reports the version as a number. Like perhaps remove all the dots after the first one and do some zero padding (so 1.9.1 → 1.09001). Without the padding 1.10.2 (1.102) will come before 1.9.1 (1.91).

    There are also some forum posts you might find that do hacky tricks to use the API to generate HTML table code which can be displayed by the Text widget.

  • I’m not sure how color bars would work for properties since they are not numbers but perhaps there is a way to implement something close.

    Yeah they would need to implement a more complex system for this to handle dates for example. But things like TimeSpan exist in most languages.

    Maybe being able to create global functions (from my other Feedback request post) could simplify this. Then in the widget expression field you call that function to return the integer value for use in colour bars.

  • For any complex reporting out of LM, I use the API.  The reports have limitations that make it difficult to pull the info needed in most cases we’re hoping to use them for, and the table widgets have even more limitations… creating output tables in powershell is my goto for these and usually only takes 15-20 minutes to make a new novel report given I’ve already written the code to pull devices, groups, datasources, etc… I fill variables with each pertinent piece, then conjoin the bits and pieces to create the output I need to hand off.  I then store that resulting data-munging script for later use. I’m hoping the UIv4 refresh of these widgets will address some of these issues.

    For version number storage, I either use a version property I’ve defined:
    <app1Name>:1.20.4500.2,<app2Name>:34.2.10.7,…

    This allows me to keep a dataset that I can parse in powershell on the back end stored with a device.

    My general code for that is in a:
    … | select-object @{name=”app1Version”;expression={($_.customproperties | where name -match serialStore).value}}

    From there, you split on the comma and search for the app name… split on the : and take the rightmost chunk:
    $var.split(“:”)[-1]

  • I do something similar. I create a datasource that pulls the data via the api, makes some html (usually using jinja2) and pushes that html to a rich text widget on a dashboard. Gives me complete control over what shows up, how it’s displayed, sortable columns, filtering, etc.

    The datasource datapoint is just a return value along with the number of things processed.