Issue

In this scenario, you create a SmartObject from the SharePoint Library and enable ODATA for that SmartObject from the K2 Management page. Next, you open PowerBI or Excel and select the OData feed as the data source and try to load this SmartObject. Next, you'll receive an Internal 500 error. This error occurs on IIS and it is possible to find it in K2 site log.

The error message text is as follows:


"GET /api/odata/v3/portal_domain_com_Document_ODataTest - 443 domain\k2service XXX.YYY.ZZZ.XXX Microsoft.Data.Mashup+(https://go.microsoft.com/fwlink/?LinkID=304225) - 500 0 0 2465"

If you remove the document from the SharePoint Library, you will see that the load "works" and it does not give you this 500 error. The problem only occurs with SharePoint SmartObjects, and when the library has documents in it.

Symptoms

When trying to use K2 Five OData API to access a SharePoint library based SmartObject from either Excel or PowerBI, you receive an Internal 500 error. 

Resolution

To resolve this issue please do the following:

  1. Go to K2 Management > Categories > SharePoint 2013 > Libraries and Select the SmartObject used in the OData (SharePoint Document Library)
  2. Scroll down to the "SmartObject OData API" section
  3. Change the Primary key of the SmartObject to ID
  4. Click on 'Refresh Now' and then try to load the data in Excel or PowerBI.