Aras Innovator Platform

Filtering Items Extended condition in

To implement the in extended condition, the OData Interface has introduced the in() filter function. This function enables you to request specific information related to an item. In the following example, the first argument is the property name, the second argument is the collection to look in, and the third argument is the property name of the collection element:

GET http://host/server/odata/xPropertyContainerItem?$select=id,itemtype&$filter=in(itemtype,$root/ItemType($select=id; $filter=name eq ‘Part’),'id’)

AML:

<Item type="xPropertyContainerItem” action="get” select=”name,itemtype”>

<itemtype condition="in” by=“id">

<Item type=“ItemType” select=“id">

<Name condition=“eq">Part</Name>

</Item>

</itemtype>

</Item>

Response:

HTTP/1.1 200 OK

{

"@odata.context": “http://host/server/odata/$metadata#xPropertyContainerItem(id,itemtype)”,

“value": [

{

"@odata.type": "#Part”,

“id": “048…3BC ",

“itemtype": “4F1AC04A2B484F3ABA4E20DB63808A88"

}

… other xPropertyContainerItem items with Part data_source

]

}

You can use the in() function with other item types as well:

GET http://host/server/odata/Part?$filter=in(created_by_id,$root/User($select=id; $filter=login_name eq ‘jsmith’),'id’)

AML:

<Item type="Part” action="get">

<created_by_id condition="in” by="id">

<Item type="User” select="id">

<logon>jsmith</logon>

</Item>

</created_by_id>

</Item>

Response:

HTTP/1.1 200 OK

{

"@odata.context": “http://host/server/odata/$metadata#Part”,

“value": [

{

“id": “048…3BC ",

“item_number": “Part-1",

“itemtype": “4F1AC04A2B484F3ABA4E20DB63808A88"

… other Part item properties

}

… other Part items created by User ‘jsmith’

]

}