DataModelSchema – Cannot de-serialize database. The JSON input is not properly formed.

  • DataModelSchema – Cannot de-serialize database. The JSON input is not properly formed.

    Posted by DSC Communities on March 31, 2023 at 8:05 pm
    • Travis Works

      Member

      March 31, 2023 at 8:05 PM

      Please help me.Ā  I am trying to update a large number of PowerBI datasets by programatically modifying the DataModelSchema files.Ā  The updated JSON looks perfect when I view it using any online viewer, but when I zip up a .pbit containing the updated file I get the error message “Cannot de-serialize Database. The JSON input is not properly formed. Check path ”, line 0, position 0.”

      I have tried a number of editors and get the same message with each of them (starting with simple text editors and eventually going so far as to read it line-by-line into a SQL table and write it back out to a text file through SSIS).Ā  I know that PowerBI can read the JSON, because if I make an error in the file it tells me exactly where it is (for example, “Check path ‘model.tables[4].measures[19].variations[0]’, line 3729, position 7.” so I am fine with that.Ā  It’s when there are no apparent errors that I get the “Check path ”, line 0, position 0.” message, which tells me nothing.

      When I open the DataModelSchema file in notepad++ and make a simple attribute change (for example, change “IsHidden” from true to false) I can zip up the .pbit and open it fine, and it reflects the change.Ā  But if I make the same change using find and replace I get the “Check path ”, line 0, position 0.” message again.Ā  Also, if I make other changes that seem like they should be just as harmless (for example, change the name of a measure) I get that message again.

      I have searched online and found suggestions such as look for un-escaped special characters or delete the SecurityBindings file, but none of those have helped (and wouldn’t explain why a manual change works for some attributes but not others, or why find/replace doesn’t work).

      Has anyone else had this problem, or does anyone have suggestions for how to fix it?Ā  I have been working on this for days, so thank you for any help you can give!

      ——————————
      Travis Works
      SQL Developer
      Tempe
      6025701857
      ——————————

    • Dili Timor

      Member

      April 10, 2023 at 8:22 AM

      Usually JSON need the right path to extract, such $.[*] or any path that pointed to the data

      ——————————
      Dili Timor
      Freelance Power BI Dev
      ——————————
      ——————————————-

    DSC Communities replied 3 years ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘DataModelSchema – Cannot de-serialize database. The JSON input is not properly formed.’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!