Question

How to select entity properties to return when creating a record via OData (or prevent newly created object from being returned)?

When creating an entity record via OData the entire entity object is returned in the response. There are times when this is not needed and having this returned every time can add a lot of unneeded size/time to the response. 

Is there any way to tell the OData API to *not* return the created object? Or at least be able to limit the fields returned instead of everything? I tried adding a $select to the request, but that seems to be ignored. I have a lot of records to create via OData and it would be great to reduce the size of the payload retuned in the response. 

Additional info: I am using JSON for my requests and I do have an Accept header value of "application/json;odata=verbose”. Not sure if the "verbose" is telling to to return the entire object, what other choices there are here besides verbose? I've tried "minimal" and a few other things but it just causes an UnsupportedMediaType response. I also tried adding a Prefer header with "return=minimal" (with no luck) per the Odata specs.

Thank you.

Ryan

Like 0

Like

3 comments

OData - is a very simple tool that allows creating fully functional integrations. On the one hand its easy to use on the other hand its slow and it doesn't allow micro adjusting. 

For professional integrations it's recommended to use custom web services. 

https://academy.bpmonline.com/documents/technic-sdk/7-13/how-create-cus…

OData it's a web service so you'll be able to call and use your own web service in the same way as how you use OData. Please don't forget to use sessions. 

https://academy.bpmonline.com/documents/technic-sdk/7-13/executing-odat…

 

Eugene Podkovka,

Thanks Eugene. This is what I suspected.

It would be nice to expand the capabilities of the OData API to support things like this to make it more capable and perform better for larger integrations. Specifically, more ability to limit payload size as well as deep inserts (inserts with nested payloads to create parent and child data in one request). These would be a fantastic additions. 

Ryan Farley,

I have forwarded your request to our business analysts. They will evaluate the possibility of implementation in future system releases. Thank you for helping us to make our application better!

Show all comments