Tag Report Tool and Tag Custom Properties

Hi all,
is there any way to find tags which have a given custom property, say CustomProp1, and where that custom property has a given value, say CustomProp1=='temperature' ?
I'm trying to do that with the Tag Report Tool and then copy the relevant query script, but I can't.

Thanks for your help, regards

I tried to do the same with parameters, to show UDT instances where a certain parameter is set to a value. I had no luck. Hopefully someone knows

If you open up the tagreport tool and then at the bottom area type in the dropdown box the property that you are looking for.

Example

That is searching for a custom property that we have on our UDT's called 'Tag'.

That search generates this script

provider = 'Development'
limit = 100

query = {
  "options": {
    "includeUdtMembers": True,
    "includeUdtDefinitions": False
  },
  "condition": {
    "attributes": {
      "values": [],
      "requireAll": True
    },
    "properties": {
      "op": "Or",
      "conditions": [
        {
          "op": "And",
          "conditions": [
            {
              "prop": "Tag",
              "comp": "Like",
              "value": "C100"
            }
          ]
        }
      ]
    }
  },
  "returnProperties": [
    "tagType",
    "quality"
  ]
}

# Limited to 100 rows. Use continuationPoint functionality to continue from last result, 
# or remove limit for full results.
results = system.tag.query(provider, query, limit)

We use this in our systems to help customers find devices/tags.

3 Likes

I've been unable to search for a Parameter by simply typing in the parameter name. However, I was able to search for "Parameters" w/ "Has", and then adding the "Parameters" property to the output to interrogate the ExtendedPropertySet returned from the query:

Query as JSON: All Tags w/ Parameters
{
  "query": {
    "options": {
      "includeUdtMembers": false,
      "includeUdtDefinitions": false
    },
    "condition": {
      "attributes": {
        "values": [],
        "requireAll": true
      },
      "properties": {
        "op": "Or",
        "conditions": [
          {
            "op": "And",
            "conditions": [
              {
                "prop": "parameters",
                "comp": "Defined"
              }
            ]
          }
        ]
      }
    },
    "returnProperties": [
      "parameters",
      "tagType",
      "quality"
    ]
  },
  "columns": [
    {
      "alias": "",
      "key": "path",
      "type": "property",
      "visible": true,
      "width": 131
    },
    {
      "alias": "",
      "key": "tagType",
      "type": "property",
      "visible": true,
      "width": 95
    },
    {
      "alias": "",
      "key": "quality",
      "type": "property",
      "visible": true,
      "width": 90
    },
    {
      "alias": "",
      "key": "parameters",
      "type": "property",
      "visible": true,
      "width": 544
    }
  ]
}

From there, should be able to formulate a more detailed query for your application.
For example, change the above query to:
Parameters, Like, *Parameter[pUnits]={datatype=String, value=°C}*
To get a report of all tags with a 'pUnits' parameter with a value of deg Celsius.