Forum Discussion

keinshah's avatar
keinshah
Helper I
1 year ago
Solved

undefinedPower BI error NULL

Hello community,

 

I have my data source as MS business central. When I refresh on desktop, it works fine without any errors. However, when scheduled refresh or manual refresh online, it returns the below 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: LotNoInformationList.
Cluster URI: WABI-UK-SOUTH-B-PRIMARY-redirect.analysis.windows.net
Activity ID: 50d92772-e7ba-4953-8dd1-dd60c4ec3044
Request ID: d9f0b6f9-b3c6-1882-5d96-93f34fb03110
Time: 2024-09-03 15:35:47Z

 

 

Similar error on all my reports with various datasets. This triggered today morning onwards.

 

I did try to remove the 'null' from the dataset, but still the error persists.

 

Any tips on how to resolve it?

 

 

Many thanks.

 

  • Dejan-Pajk's avatar
    Dejan-Pajk
    1 year ago

    The latest version of the connector no longer permits the 4th parameter to be null.

    Please try the following solution:

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

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

52 Replies

  • Ianc33's avatar
    Ianc33
    Frequent Visitor

    I'm getting the same error and it is only from reports that use Business Central as the data source.

  • MarkModdy's avatar
    MarkModdy
    Frequent Visitor

    This work around fixed it for me too, many thanks for your assistance.

     

    Greatly appreciated.... off to rework 35 reports too now 😞

  • Ianc33's avatar
    Ianc33
    Frequent Visitor

    Thanks Dejan-Pajk,

     

    That fixed it for me too...

     

  • Hittheroof24's avatar
    Hittheroof24
    Regular Visitor

    I've had the same happen to me today - absolute nightmare! 

    Opened a ticket with Microsoft and they suggested the following (neither of which has resolved the issue) 

    - Are you utilizing the latest version of Power BI Desktop to ensure compatibility and feature support?

    - The dataset might contain null or empty values that the OData connector cannot process as a Record type. So, are there any null or empty values in the source data? If yes, try to remove these values.

    So currently manually updating 30+ reports in preparation for tomorrow morning...

    • Dejan-Pajk's avatar
      Dejan-Pajk
      Advocate II

      The latest version of the connector no longer permits the 4th parameter to be null.

      Please try the following solution:

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

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

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi,

        Thanks for the suggested solutions.

        null, null, null , [userReadOnlyReplica = null

        seems to work,

        null, null 

        Doesn't work with my reports.

         

        Any idea why this connector update/ change wasn't communicated? It has a large effect.

        Now I have to update alot of tables in alot of reports.

        Any idea if there will be another update to fix this?

        Or does anyone have a hint on how to change this in a way other thatn opening all tables from all affected reports in the advanced editor and change the first few lines?
        (I'll make a base table with the route to the database and link to this table in all the other tables, like a parameter.
        So that when another update is required I only have to change one table)

         

    • keinshah's avatar
      keinshah
      Helper I

      I did remove all NULL values manually. But still it is not working. Let me know if you manage to solve the issue.

      • pdolan_tapco's avatar
        pdolan_tapco
        Frequent Visitor

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

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

  • Riegel7's avatar
    Riegel7
    Regular Visitor

    Exactly the same error here as well with Business Central as the data source.

     

    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: xxx

     

    I've been doing some testing and I can refresh the report locally in Power BI Desktop which works fine, but I get this error when I publish to the Power BI service? If anyone can suggest anything I'm all-ears...

    • Dejan-Pajk's avatar
      Dejan-Pajk
      Advocate II

      The latest version of the connector no longer permits the 4th parameter to be null.

      Please try the following solution:

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

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

      • Sailor1000's avatar
        Sailor1000
        Frequent Visitor

        Hi Dejan-Pajk
        It solved my problem. 
        A lot of work know updating all the queries. 
        Do you think Microsoft will fix this? Becouse I created a new dataset for tests, and got the same problem. 
        Thank you!

  • PowerBenjI's avatar
    PowerBenjI
    Regular Visitor

    Ahh thank you so much! Same issue here. Spent several hours today trying to fix this. Would be great if the troubleshooting messages in PowerBI were a bit more precise..

  • OutofSpec's avatar
    OutofSpec
    Frequent Visitor

    I am new to Power BI.  Does anyone have a SOP to show how to apply the fix?

     

    The latest version of the connector no longer permits the 4th parameter to be null.

    Please try the following solution:

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

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

    • virakones's avatar
      virakones
      Advocate I

      In your powerbi desktop report > Transform data > select and highlight your Business Central related query > open Advanced editor > replace the first line as described above > Ok > Close & Apply once updated to all BC related queries

      • OutofSpec's avatar
        OutofSpec
        Frequent Visitor

        This fixed my issue in Power BI Desktop, thank you!

         

        But now when I upload it to my Power BI dashboard and run it, it bombs out still.  Any ideas?

         

        • Commisions_Sales_Line_Detail_Excel
          The OData connector failed with the following error: We cannot convert the value null to type Logical..
  • Microsoft supposedly rolled out a fix yesterday but I am still getting an error when trying to connect to the Business Central API. Note: This is not for an existing file where I can edit the URL. This is for a NEW connection so I am currently stuffed. 

     

    Any suggested solutions?

     

    https://support.fabric.microsoft.com/en-US/support/

     

     

    • GrooveLife's avatar
      GrooveLife
      New Member

      Did you get this solved? I also have a user in my org that is having this issue.

      • JS_UNI4C's avatar
        JS_UNI4C
        Helper I

        Yeah, downgrading the desktop app to the old version sorted the problem out. You have to manually download it off Microsoft website, uninstall current version and then install the old version. Connected to API perfectly. 

    • DeanUW's avatar
      DeanUW
      Helper I

      Not sure if you found a fix,  I also was recieving that error for my Biz Central connections.  In Power Query I clicked the "Go To Error" button then clicked "Edit Settings"  the next window that pops up gives you 'Optional' places to enter data.  I left them all blank, just click ok & the connect went through; I was able to save & apply, then refresh my data afterwards.  Hope this helps.