Filtering by Extended Property Definition
Copy
Use is_defined the filter function to filter request results using the extended property definition and how the property is defined (either explicit or through extended class):
GET http://host/server/odata/Part?$filter=is_defined(xp-cost)
AML:
<Item type="Part” action="get">
<xp-cost condition="is defined"/>
</Item>
Response:
HTTP/1.1 200 OK
{
"@odata.context": “http://host/server/odata/$metadata#Part”,
“value": [
{
“id": “048…3BC ",
“item_number": “Part_with_Defined_xp_cost”,
“itemtype": “4F1AC04A2B484F3ABA4E20DB63808A88"
… other Part item properties
}
… other Part items with defined xp-cost
]
}
You can request a property that is defined in a specific way:
GET http://host/server/odata/Part?$filter=is_defined(xp-cost,explicit)
AML:
<Item type="Part” action="get">
<xp-cost condition="is defined” defined_as="explicit"/>
</Item>
Response:
HTTP/1.1 200 OK
{
"@odata.context": “http://host/server/odata/$metadata#Part”,
“value": [
{
“id": “048…3BC ",
“item_number": “Part_with_Defined_xp_cost”,
“itemtype": “4F1AC04A2B484F3ABA4E20DB63808A88"
… other Part item properties
}
… other Part items with explicitly defined xp-cost
]
}
Use the Negate operation to request items that do not have a specific extended property defined:
GET http://host/server/odata/Part?$filter=not is_defined(xp-cost,class)
AML:
<Item type="Part” action="get">
<xp-cost condition="is not defined” defined_as="class"/>
</Item>
Response:
HTTP/1.1 200 OK
{
"@odata.context": “http://host/server/odata/$metadata#Part”,
“value": [
{
“id": “048…3BC ",
“item_number": “Part_with_xp_cost_not_Defined_in_Class”,
“itemtype": “4F1AC04A2B484F3ABA4E20DB63808A88"
… other Part item properties
}
… other Part items with xp-cost not defined via xClass
]
}