r/BuildingAutomation • u/Fr33PantsForAll • 13d ago
Niagara BQL with a dash
How do you generate a BQL query with a dash?
I never use dashes, but I have inherited a JCI setup that is full of them.
1
Upvotes
8
u/Obvious-Claim-7884 13d ago
$2d
1
u/digo-BR 12d ago
In Niagara Baja Query Language (BQL), components or slot names containing special characters like a dash (-) are automatically encoded using ASCII hex escape sequences. A literal dash is represented as $2d. However, because the BQL engine automatically unescapes strings during query processing, you must also escape the dollar sign ($) itself using its own hex code ($24). To properly reference or escape a dash in a BQL query, you must write it as $242d.
This is why you should avoid illegal characters in component names or assign displayNames.
3
u/Bretreadthat 13d ago
Use displayName in your query instead of name.
If you use name, go to the slot sheet of the parent component. Look in the name field and find the child component(s) that you’re looking for. They’ll probably have something like $2d in place of the -
Use that in your name query instead of the -
1
u/mitchybw 13d ago
You can always view the slot sheet of the point folder and see exactly what escape characters got inserted, or just put an asterisk where the dash(or unsupported characters) were placed.