SWQL Custom Query - Group Container Status Icons

First THWACK post, so take it easy on me.  I'm trying to get a SWQL query to include the Group Container status icons in the table.  I've reviewed other posts and have been able to widdle the query down to a couple of options but I can't get the gif image to show correctly for Option #1 and I can't get the icon color to show on Option #2.  I'm open to other alternatives too.

SELECT g.StatusDescription AS Status,
g.Name AS Name,
gcp.Group_Team_Responsible AS Division,
gcp.Group_Severity_Level AS [Service Criticality],
g.DetailsUrl AS [_LinkFor_Name],

CONCAT ('/Orion/images/StatusIcons/Containers/Small-?entity=Orion.Groups&status=', 'G.StatusDescription') AS [_IconFor_Status] - Option #1

--CONCAT ('/Orion/StatusIcon.ashx?entity=Orion.Groups&status=',G.StatusDescription) AS [_IconFor_Status] --- Option #2 -- This is also an option, compared to the one above, IF I can get the icon colors to show up.


FROM Orion.Groups g

FULL JOIN Orion.GroupCustomProperties gcp ON g.ContainerID=gcp.ContainerID

Option #1 Result:



Option #2 Result:

Parents
  • Hi, glad you found my article at  SWQL Custom Query – Status Icons easy 

    Groups are called Containers behind the GUI. So a working query looks like this:

    SELECT 
        G.StatusDescription AS Status,
        G.Name AS Name,
        G.DetailsUrl AS [_LinkFor_Name],
        G.CustomProperties.Group_test_CP
        ,CONCAT('/Orion/StatusIcon.ashx?entity=Orion.Container&status=',G.Status) AS [_IconFor_Status]
    FROM Orion.Groups AS G
    
    

    You can see I changed your "Orion.Group" in the url to "Orion.Container". Also status should be a numeric value, status, not statusdescription. I'll update my article with some more info. (...not, that was locked for editing now....)

    Also, you don't have to JOIN in CustomProperties as SWQL already know how to join them. Instead just "jump" from table to table, like I did with my test-customproperty: G.CustomProperties.Group_Test_CP

    (Update the custom properties to they match your need)

    Good luck!

  • Thanks everyone for the feedback!  The below CONCAT worked perfectly as I had hoped.

    CONCAT('/Orion/StatusIcon.ashx?entity=Orion.Container&status=',G.Status) AS [_IconFor_Status]

Reply Children
No Data