A UserQuery special object produces a table on a diagram where the rows and columns are derived from the ControlDraw database by a query that is written into the UserText field of the symbol
In a UserQuery you can use clauses like Where Page ={CurrentPage}
For example a UserQuery with
Select Tagname, Class FROM qryPageObjects where Page ={CurrentPage}
will produce a list of the objects on the diagram and their classes
You can use {CurrentSymbolID} to get the IDD of the connected symbol so that you can link to and display data from other related tables.
For example "Select Stateno, Name as State from tblDynamics where SymbolID={CurrentSymbolID}"
You can use a Query from the Favourite User Queries by prefixing the name with FAV:
Use {CurrentSymbolTag} to get the Tagname of the connected symbol and {CurrentSymbolChildPage} to get the child page number.
For a UserQuery special object, if the text is positioned in the centre then the this query string is hidden, otherwise it is shown in the selected position.
With User Query special objects, if the resulting table has more than one record, and a field contains Line Feeds these are replaced with ' : ' in order to keep the lines aligned. If there is only one record (eg Select Formula from tblDrawingObjects Where IDD={CurrentSymbolID}) then the complete text is shown.
Many Examples of User Queries are contained in the standard reference and sample models provided with ControlDraw.