Object Tree Selection

This article describes new features of WebAPI added in version 1.0.1

LoadTree and QueryTree methods have been added to EntityService. They receive the additional select parameter. This parameter must receive a selection string of properties and nested objects. The string format is taken from the format of the OData $select parameter.

Below you can see a description of the selection syntax:

ABNF for the tree’s query structure:

* - selects all the object properties as one nesting level 
/ - divides the nesting levels of the object properties 
, - unites the results of various queries 

The general structure of a query:
COMMA = ","
star = "*"
separator = "/"
propertyName = Name of a simple type property
navigationProperty = Name of an Object, Object List, Block type property
selectItem = star | propertyName | navigationProperty [ separator selectItem ]
selectClause = selectItem *( COMMA selectItem )

For example, you can list the required properties by separating them with a comma, or select the data of a linked object:

  • *- symbol meaning that all the accessible object properties must be selected and put at one level. This symbol can be used on any nesting level.
  • Subject, CreationAuthor, Description, StartDate, EndDate – the Task object type requires you to select only the Subject, Author, Description, Start Date and End Date properties. In this case, the rest of the properties will not be returned in the server’s response.
  • Subject, Description, CreationAuthor/UserName, CreationAuthor/FullName- the Task object type requires you to select the Subject and Description properties, and for the Author property (User object type) select the Login and Full Name properties.
  • Subject, Comments/*- for the Task object type select the Subject property, and for the Comments property of all the other objects select all the available properties.
  • ChildTasks/Subject, ChildTasks/Comments/*, ChildTasks/Comments/CreationAuthor/FullName- the Task object type requires you to select the subjects of all the subtasks, all the properties from comments, and full names of the comment authors.

This way you can combine the levels of linked objects and required properties in order to reduce the number and length of queries.