Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
alamp
Frequent Visitor

We cannot convert the value null to type Record

Hi All, I am struggling with the issue of "Cannot convert the value null to type Record".

I am using Businesss central api is to create a report in power bi. I has been working fine from last 2 years and all of a sudden it has started giving this error. This is not letting power bi reports which are connected to business central to refresh. 

 

I have tried multiple solutions but couldn't find the issue. 

I do not have any column with null values and done everything to resolve it. I am using a simple query to just fetch the data. 

 

Below is the error

Data source error: Expression.Error: The OData connector failed with the following error: We cannot convert the value null to type Record... . The exception was raised by the IDbCommand interface. Table: Accounts of Sales
Cluster URI: WABI-US-NORTH-CENTRAL-B-redirect.analysis.windows.net
Time: 2024-09-11 17:25:44Z

1 ACCEPTED SOLUTION
Idrissshatila
Super User
Super User

Hello @alamp @ZooTV 

check this solution

Have you tried the fix on the below link? 
https://www.reddit.com/r/PowerBI/comments/1f7yadg/data_conversion_error_on_refresh/

We encountered the same error and by adjusting the 4th parameter on the API call, the problem went away

Before:
Dynamics365BusinessCentral.ApiContentsWithOptions(null, null, null, null)

After:
Dynamics365BusinessCentral.ApiContentsWithOptions(null, null, null, [UseReadOnlyReplica = null])

also you can follow the issue to get updated
https://community.fabric.microsoft.com/t5/Issues/The-OData-connector-failed-with-the-following-error...

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




View solution in original post

9 REPLIES 9
alamp
Frequent Visitor

Thanks guys for the responses. Managed to resolve for few of the reports but not all. Still looking for permanent solution. 

 

Idrissshatila
Super User
Super User

Hello @alamp @ZooTV 

check this solution

Have you tried the fix on the below link? 
https://www.reddit.com/r/PowerBI/comments/1f7yadg/data_conversion_error_on_refresh/

We encountered the same error and by adjusting the 4th parameter on the API call, the problem went away

Before:
Dynamics365BusinessCentral.ApiContentsWithOptions(null, null, null, null)

After:
Dynamics365BusinessCentral.ApiContentsWithOptions(null, null, null, [UseReadOnlyReplica = null])

also you can follow the issue to get updated
https://community.fabric.microsoft.com/t5/Issues/The-OData-connector-failed-with-the-following-error...

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Hi Idris, 

 

thank you for this. 

 

I have sorted the 15 reports I had already in place. However I am trying to set up a new report from scratch and when I try to select the tables from our ERP (Business Central), I got the same error. In this case I cannot open the table and set up the forth value to  [UseReadOnlyReplica = null]). 
Any idea how to sort it out?

Hi @RosaPequeno ,

 

If possible could just put here the source line of your code or more. 

 

Hi @alamp 

thank you for your reply. 
I am afraid there is no code yet. 
It is blank report where I click in "Get Data", chose "Dynamics 365 Business Central" and then I cannot select any source

RosaPequeno_0-1726736345315.png

 

I think this also worked and MS has patched the error now. Few of the reports i didn't changed anything and it's working now. Thanks guys. 

Hi @Idrissshatila , Thanks for the response. This is has worked for few of my report but not for all. I have raised a case with MS product team as well. 

I will update you once i get any permanent solution. 

ZooTV
Frequent Visitor

I found this thread, which may shed some light on the problem.
The OData connector failed with the following erro... - Microsoft Fabric Community

ZooTV
Frequent Visitor

I am having the same issue, which appeared 2-3 days ago..

The error is:

"Data source errorExpression.Error: The OData connector failed with the following error: We cannot convert the value null to type Record... . The exception was raised by the IDbCommand interface"

 

I am able to perform a "Refresh" via the desktop app and re-publish successfully. But the update scheduled within the semantic model continuously fails.
It also seems to failing on different tables each time.   

I will keep investigating.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.