Axon Tips

Below are some useful axon tips.

Querying something that contains, starts with, or ends with

If you want to query for something that is found in the navName, you can do so with the query: readAll(filter).findAll x=> x->navName.SearchTag("whateverYouWantToSearchFor")

Breaking down the query:

readAll = read all records from the database which match filter.

filter = any filter you want to search for like "point and navName and equipRef->vav" or "point and navName" (Note: make sure to include navName in the filter because if a record for some reason doesn't have the navName tag, it would error out)

findAll = find all the items in a list, dict, or grid that is returned from the readAll filter

x=> = this is a function within the findAll that goes through all of the items in the readAll filter. The x variable is the item.

x->navName = the arrow (->) is a trap operator. What this is doing is looking at the variable and looking at its own navName tag. (Note: navName can be replaced with any other tag found on the records you're filtering)

searchFunc = replace with one of these options: contains, startsWith, endsWith

whateverYouWantToSearchFor = this is what you are looking for in the navName. For example an underscore ("_") or word ("Temp")

 

Example: readAll(point and navName).findAll x=> x->navName.contains("RMT")

This finds everything that has RMT somewhere in the navName and is a point.

Note: To query for something that is found in the dis tag instead of navName, replace navName in the above examples with dis and it should work.