5 Replies Latest reply on Nov 16, 2017 4:55 PM by billcjr

    swql

    billcjr

      I am running Orion Platform 2016.2.100, NCM 7.5.1, NPM 12.0.1.

       

      I am trying to use a NPM custom property (Internet_Device) in a NCM view resource (graph). From what I have been reading it can be done by using SWQL. The custom property (Internet_Device) is a Yes/No Node property so I was using the syntax:

      Nodes.CustomProperties.Internet_Device='True'

       

      But I keep getting the error:

      There was an error while loading data for this resource.

      RunQuery failed, check fault information...

       

      It may just be something I am doing incorrectly but I have been unable to locate the root cause to this error.

        • Re: swql
          mesverrum

          Can you post a screenshot of the place you are entering that filter?  I don't think I recall which graph resources allow filters like that.

            • Re: swql
              billcjr

              I have edited the original post and attached a screenshot to that.

                • Re: swql
                  tdanner

                  Hi Bill,

                   

                  I'm looking into this.

                    • Re: swql
                      tdanner

                      There's a bug in this Edit page. Whatever you put in the "filter" text box gets validated using a query that is different than the one used to fetch data for the actual pie chart. The result is that any filter that passes the edit page's validation won't actually work. And a filter that would work won't pass the validation!

                       

                      The pie chart's query uses 'O' as an alias for Orion.Nodes, so the filter that would work is this: O.CustomProperties.Internet_Device=1

                       

                      Because of the validation bug, you can only set that as the filter by editing the database. Proceed with caution.

                       

                      1. Make sure you have configured the resource the way you want it other than the filter. Once you set an "invalid" filter, the Edit page won't let you click Submit unless you remove it.

                      2. Find the ResourceID value for your pie chart. The easiest way to do this is to go to the edit page and look at the URL. Right after the '?' it should have "ResourceID=1831" or some other number.

                      3. Use SQL Server Management Studio or your favorite database query tool to run this query, replacing 999999 with your actual ResourceID value:

                       

                      UPDATE ResourceProperties

                      SET PropertyValue='O.CustomProperties.Internet_Device=1'

                      WHERE ResourceID=999999 AND PropertyName='FilterClause'