1

I am changing a lot of fields with a REST POST/MERGE request to a list item. When an input is wrong, is there a way to figure out WHICH field caused the 400 error? All I get is this useless response:

{
  "odata.error": {
    "code": "-1,     Microsoft.SharePoint.Client.InvalidClientQueryException",
    "message": {
      "lang": "de-DE",
      "value": "Input string was not in a correct format."
    }
  }
}
1
  • Please share your code snippet. Commented Nov 15, 2019 at 16:20

2 Answers 2

4

Unfortunately NO, I did not come across any way to identify which value has caused 400 bad request error.

Workaround is to remove column & respective input one by one and check the fields for which you need to make the input in proper format.

1

I agree with Ravi that there isn't any way I know of to get more information, but there is a bit of information there. It mentions input string so one of the columns in the list is expecting a string and either you've mangled a string or your trying to pass a number, boolean, or other value.

First instinct is usually to look at the data that is marked as string, but often the problem is the other way -- something in your passed data that should be a string, but isn't. So look at your list and see that all the ones that are string types are actually being passed in your code as strings.

There is also the Unexpected 'PrimitiveValue' node error which means that you've passed a primitive (simple) value when it is expecting a collection-type object.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.