Orion Custom SWQL Query Search & Reference Table

This is a simple table (using Google Charts) which lists all custom query widgets, as well as their contents. This table can be used to reference all of the customer query widgets and SWQL code currently implemented throughout an environment. I typically just use a standard custom query widget to display all my SWQL, instead of this fancy table, but I very much prefer the cleaner layout of the table.

To use this, you will need to download this HTML/JavaScript file, add a "Custom HTML" widget to a summary view, and then copy/paste the contents into the custom HTML widget. The queries within this JS do not reference any custom properties, so it should just work. If not, make sure your system can communicate with where the Google Charts files live.

Once loaded into a custom HTML widget, you should see something similar to the screenshot below. This is the list of custom query resources in your environment.

Clicking on any of the results listed in the table to the left will populate the contents of that resource, as seen below. If the resource has the search feature enabled, then queries for both the "SWQL" and "SearchSWQL" parts will be listed.

As always, if you get clever about how you title (and subtitle) the various custom query widgets, or add specific/coded comments within the queries themselves, you can create better filters. This can allow you to easily group similar purposed queries together, such as "Group", or "Node Detail", queries. As an example, looking at the 2 queries below, we could add to the filter within the table and only return results with ${ID} or ${NodeID}, returning only the results which would specifically be used on their respective view types. (Again, a good title/subtitle/commenting scheme can also make it very easy to categorize your queries too.)

Once you find something you like, need, or want to use, you can simply copy it from here.

If you're in a pinch, and you have a couple helpful links handy, you can paste your query in and work on it directly within Orion itself. (/orion/Admin/swis.aspx)

A long while back, I had posted how to get this table up and running, though for a slightly different purpose. It was just a basic table which helped to manage views a little more cleanly. The results displayed in that table, however, did not require any particular formatting. Now, for this new table, I kept running into issues with the SWQL formatting when displaying the queries. I could not figure it out, and almost decided I wasn't even going to post it. Before I lost anymore of the little mind I have left, I asked my co-worked, , who is an amazing fixer and maker better-er of things, for help. I showed him what I had, and how messy it looked, and Matt had fixed it shortly after I had asked him for help. Matt is also responsible for many of the other JavaScript/Google Charts tools I have posted in the past, and he's also responsible for getting this table to retain the formatting for the queries. Thank you, Matt!



While I cannot remember where all the various pieces of this query originated, I do know it was from folks in this community, so I'll just credit THWACK. (Which is basically what I'll need to say for anything and everything I post...)



Thank you,