user43286
user43286

Reputation: 2321

How do I skip, select, top on the $expand in OData?

How do I skip, select, top on the $expand in OData? Why the following is not working?

http://services.odata.org/V4/(S(s2sx534tmya3oqnyfxumtyl1))/TripPinServiceRW/People?$expand=Friends($select=Emails&$top=1&$skip1)

But if I use only either $select or $top or $skip in the expand it works. For example, the followings works. Why the above is not working? I assume this is a Odata limitation.

http://services.odata.org/V4/(S(s2sx534tmya3oqnyfxumtyl1))/TripPinServiceRW/People?$expand=Friends($select=Emails)

http://services.odata.org/V4/(S(s2sx534tmya3oqnyfxumtyl1))/TripPinServiceRW/People?$expand=Friends($top=1)

Upvotes: 4

Views: 4350

Answers (1)

TomDoesCode
TomDoesCode

Reputation: 3681

Within the expand you need to use semicolons to separate the different options instead of ampersands. This URL should work:

http://services.odata.org/V4/(S(s2sx534tmya3oqnyfxumtyl1))/TripPinServiceRW/People?$expand=Friends($select=Emails;$top=1;$skip=1)

Upvotes: 7

Related Questions