Query Tips
Copy
- Using the select attribute
The select attribute enables you to filter down the set of properties for the Items returned from a query.<Item type="Part” action="get” select="part_number,part_description,part_cost"/> - Using the order_by attribute
The order_by attribute enables you to order the results of the query. The style sheet also supports sorting on the properties.<Item type="Part”action="get”select="part_number,part_description,part_cost”order_by="part_number”/>
- Using the condition attribute
The condition attribute enables you to specify a condition for the properties used as search criteria. All the conditions that are allowed in SQL are allowed as the values to the condition attribute.
NoteThe greater then and less then symbols are replaced with the two-letter pneumonic word. The < symbol is lt, and the > symbol is gt, >= is ge and so on.
<Item type="Part”action="get”select="part_number,part_description,part_cost”order_by="part_number"><part_number condition="like">%123%</part_number></Item>
- OR’ing property values
The <or> tag provides a way to logically OR property values for the search criteria.<Item type="Part”action="get”select="part_number,part_description,part_cost”order_by="part_number"><or><state>Released</state><state>In Review</state></or></Item> - Return Relationships in the results
You can include the <Relationships> tag and the relationship items you want to return.<Item type="{@type}" id="{@id}" action="get” select="part_no,part_desc,part_cost"><Relationships><Item type="Part EBOM” action="get” select="position,qty,related_id"><related_id><Item type="Part” action="get”select="id,part_no,part_desc,part_cost"><Relationships><Item type="Part AVL” action="get” select="avl_status,related_id(description,manufacturer,component_no)"/></Relationships></Item></related_id></Item></Relationships></Item>
- Using Relationships as search criteria
You can include the <Relationships> tag to describe the search criteria for the relationship items.<Item type="{@type}" id="{@id}" action="get” select="part_no,part_desc,part_cost"><Relationships><Item type="Part EBOM” action="get” select="position,qty,related_id"><qry condition="gt">1000</qty></Item></Relationships></Item>