Update Record Code 204 but throws error Cannot read properties of undefined (reading 'results')

I tried to build a simple app that does a put request to my sap backend and changes some data there. I implemented my odata Service and tried calling it with the update record function in appgyver. Everything works fine i fill in the required parameters in appgyver, it sends the request, i get a 204 response code and the data gets changed correctly in my system. But for some reason the update record function thinks this is an error and goes into the 2nd (bottom) output instead of going in the first (top) one. The error message is: “Cannot read properties of undefined (reading ‘results’)”.

image

image

image

What is the issue here? Does the update record not accept an empty body? But odata standard says update/put should not return data.

Here are some things you can try to resolve this problem:

Make sure your OData service is returning a response with a correct HTTP status code. For example, if you are making a PUT request to update a resource, you should return an HTTP 200 OK or 204 No Content status code.

Ensure that your OData service is returning a response with a valid response body. If you are returning an HTTP 204 No Content status code, you may not have to return any response body. However, if you are returning an HTTP 200 OK status code, you should return a response body that has at least the “results” property.

Review the documentation for your OData service and ensure that you are correctly sending the PUT request. Make sure you are including all necessary parameters in the request and sending the request to the correct URL.

Hey, thanks for your reply.

I opened a ticket with SAP and it seems like there is an issue where status code 204 is sometimes not handled as expected and they are working on a fix.

1 Like