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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to disable ODATA return limit of 25 entries

pa2t
6-Contributor

How to disable ODATA return limit of 25 entries

Hi All,

How would I disable the limit of 25 entries for ODATA REST endpoints for windchill?

ex. <server>/Windchill/servlet/odata/v3/DocMgmt/Documents ---- only returns 25 entries

 

 

Thanks,

Patrick 

7 REPLIES 7
amarsingh
12-Amethyst
(To:pa2t)

@pa2t  I am not sure what you mean by "disable ODATA return limit of 25 entries".

Assuming what you want is increasing the limit of entities return, try below:

Specify header

Prefer : odata.maxpagesize=<no of entities up to 200>

For example: adding below the header will increase the entities return count from 25 to 150

Prefer : odata.maxpagesize=150

 

Currently, the maximum root entities retrievable is 200.

ssauvage-2
14-Alexandrite
(To:amarsingh)

Hi.

@amarsingh , is there a way to configure this on the OData connector itself (that is on TWX side)?

Thanks!

I know a way by adding a custom header. There is an post already about Thingworx swagger connector but the same should be applicable for Thingworx OData Connector.

 

Link to the article: https://community.ptc.com/t5/ThingWorx-Developers/Custom-headers-for-swagger-connector/td-p/538759

MichaelChatel
20-Turquoise
(To:pa2t)

FYI, there is also a Windchill knowledge article that touches on this:

 

https://www.ptc.com/en/support/article?n=CS294238

 

 

Yes, this is the original article that explains that REST request headers should be modified to include the parameter:

"Prefer" + "odata.maxpagesize=100"

But it does not explain how to perform that at OData connector level.

I have created a short document on this here https://community.ptc.com/t5/ThingWorx-Developers/Adding-a-Custom-header-in-Thingworx-Connector/td-p/647507. Let me know if you still face difficulties

ssauvage-2
14-Alexandrite
(To:amarsingh)

Thank you very much @amarsingh !

I will test that soon, but I'm pretty sure it's the best solution, especially to automate the parameter for route services (the ones created just by using API maps).

Announcements


Top Tags