cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Translate the entire conversation x

Count number of element returned by OData request

FM_13835117
6-Contributor

Count number of element returned by OData request

My count OData request does not work :

https://<url>/Windchill/servlet/odata/v5/DataAdmin/Containers('OR:wt.pdmlink.PDMLinkProduct:681234555')/Folders('OR:wt.folder.Cabinet:681234597')/Folders('OR:wt.folder.SubFolder:681267970')/Folders('OR:wt.folder.SubFolder:681267975')/FolderContents?$count
Thanks for any help.

Fred

Version: Windchill 12.1 (Product v12.1.2.0, REST Services v2.3)

6 REPLIES 6
Fadel
22-Sapphire III
(To:FM_13835117)

Do you have duplicate objects ? can it be that you have a count for each object version ?

Fede
FM_13835117
6-Contributor
(To:Fadel)

Hello @Fadel 

Thanks for your message. I don't think I have duplicated values, but I have so many values that I get this mesasge. So I would like to paginate the results using 'count', 'top' and 'skip' parameters but it doesn't work and I wonder if it is because of the version I use.
Fred

Hi,

 

In your request URL I observed the Boolean value missing for $count, there is no issue with the version

 

https://<url>/Windchill/servlet/odata/v5/DataAdmin/Containers('OR:wt.pdmlink.PDMLinkProduct:681234555')/Folders('OR:wt.folder.Cabinet:681234597')/Folders('OR:wt.folder.SubFolder:681267970')/Folders('OR:wt.folder.SubFolder:681267975')/FolderContents?$count=true

RD_13647666_1-1755510984219.png

 

 

Hi @rajeshd105,

 

Thanks for your reply.

 

I've modified the request as you proposed : "$count=true", but server seems to request first all elements before to count and I get always the same error message 😞"The returned query result has exceeded the query limit, and only 50,000 result returned."

Sorry, I was confusing with the rest request. My apologise.

With ODATA request it works fine, Thanks a lot !

FM_13835117_1-1755523720030.png

 

Do you know how to limit the number of results ?
Fred

 

In fact, it works when the limit of 50.000 items is not reached otherwise I got the error message.

Fred

Announcements
Top Tags