Skip to main content
6-Contributor
July 30, 2025
Question

Count number of element returned by OData request

  • July 30, 2025
  • 2 replies
  • 531 views

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)

2 replies

Fadel
23-Emerald I
July 31, 2025

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

Buiꓘa
6-Contributor
July 31, 2025

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

12-Amethyst
August 18, 2025

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

 

 

6-Contributor
August 18, 2025

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."

6-Contributor
August 18, 2025

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