Synthoid / ExportSheetData

Add-on for Google Sheets that allows sheets to be exported as JSON or XML.
MIT License
234 stars 46 forks source link

Problem with the export of nested elements since last update #137

Closed Winnao closed 3 years ago

Winnao commented 3 years ago

Hello !

I'm using ExportSheetData with nested elements since a year or two, and since the last update, the export is not right :/

Before the update, we had this And now this

I don't understand why it doesn't work now :c I'll put a simplified version here of my google sheet here

Thank you !

Synthoid commented 3 years ago

I copied your linked sheet and adjusted settings to get this output:

{
  "MetaData": {
    "Joueur": "Politique2"
  },
  "UI_IntroLetter": [
    {
      "CharacterID": "Commissaire",
      "TextID": "UI_IntroLetter_Commissaire_1",
      "audioID": "UI_IntroLetter_Commissaire_1"
    }
  ]
}

Which seems to line up with your previous data. My guess is that you were exporting the sheets as arrays but that setting was disabled at some point? The {#SHEET}{#ROW} key values only really work when exporting a sheet as an array since they are assigning the key to the element at index {#ROW} in the {#SHEET} array.

In any case, the above data was generated by renaming UI_IntroLetter to JA_UI_IntroLetter and enabling the array prefix option. Nested elements and Ignore empty cells were also enabled.

Synthoid commented 3 years ago

Also, you can simplify your sheet keys by enabling the Nested array prefix option and adding the NA_ prefix to your tab name. This will let you remove the {#SHEET}{#ROW} prefixes from all of your keys.

Sorry it took a few days to get back to you! Hopefully this helps sort things out!

Synthoid commented 3 years ago

Closing this issue as I believe I have answered the question and the thread has been quiet for about a week.

Synthoid commented 3 years ago

Closing this issue as I believe I have answered the question and the thread has been quiet for about a week.