1

I've encountered a strange problem with Rest API. I use it to collect data from SharePoint to my report. It works fine for all libraries on my site except for one. String that I use:

https://<my site>/services/_api/web/Lists(guid'144bef91-f287-47f7-9ccb-6b4ffcf71b00')/Items

Funny thing is that:

 https://<my site>/services/_api/web/Lists(guid'144bef91-f287-47f7-9ccb-6b4ffcf71b00')

is returning a proper response with no errors at all.

Browser error message shows a 500 internal server message, logs show System.FormatException: Input string was not in a correct format error.

This site was updated from SP2010 to SP2013 using automated script - I wonder if this could be a root cause?

2
  • 1
    Could you try to get items with list name instead Guid and check if working site url/_api/web/lists/GetByTitle('ListName')/items Aug 25, 2017 at 18:04
  • Hello, Unfortunately, it didn't work at all. I got the same response: The website cannot display the page HTTP 500 Most likely causes: •The website is under maintenance. •The website has a programming error. Aug 28, 2017 at 6:34

1 Answer 1

0

After I got more information from logs (I'm a site admin, I do not have access to farm administration) I've found out that one of the lookup columns was causing problems.

Log data:

The field value for field DocTechnology of type Lookup cannot be serialized. Value=#ERR, Exception=System.FormatException: Input string was not in a correct format.     at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)     at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)     at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)     at Microsoft.SharePoint.SPListItem.GetFieldValueAsNonLookup(String fieldName, SPListItemEntityMetadata metadata)   1df5139e-eb1b-c0cb-a010-9e8b28f1e88f
Exception occured in scope Microsoft.SharePoint.SPListItem._SerializeToOData. Exception=System.FormatException: Input string was not in a correct format.

Solution: delete column & add it again. Fortunately, I didn't have much to fill after this operation.

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.