Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Currently I am facing some issues while querying the oData services. I am very new to oData query syntax.

I am trying to query oData service using the following url

https://mysite/DataQueryGroups?$select=Id,Name&$filter=IsHidden eq false&IsShared ne false&$expand=DataQueries($select=Id,Name,IsPinned;)

which returns the desired results to me. Above query basically returns all DataQueryGroups where IsHidden=false and IsShared<>false, including the its child entity DataQueries.
Now I want to add filter to the DataQueries enity to display only those resulsts where IsPinned = true. So I have tried the following query

https://mysite/DataQueryGroups?$select=Id,Name&$filter=IsHidden eq false&IsShared ne false&$expand=DataQueries($select=Id,Name,IsPinned;$filter=IsPinned eq true;)

But this returns me the same results and it looks like its not considering the inner filter/last filter which I have specified on DataQueries entity.

I would like to know how to filter on parent and child entities and return the fields from both.

I am finding difficulties to under this syntax. Please let me know if anybody can help me on this issue.

Currently I am using oData version 6.11.0.0

Thanking you in advance
Deepak
Posted
Updated 29-Sep-15 20:29pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900