Synthoid/ExportSheetData

Export column as keys

Closed this issue · 2 comments

Hi, I'm trying to export spreadsheet as JSON with localization data e.g

          EN    |  IT     |  FR

ID1 "en1" "it1" "fr1"
ID2 "en2" "it2" "fr2"

I would like the export JSON to be

{
"EN" : { "ID1": "en1", "ID2":"en2" }
"IT" : { "ID1": "it1", "ID2":"it2" }
"FR" : { "ID1": "fr1", "ID2":"fr2" }
}

Hmm, would you be able to provide the full context of your data? As is, the easiest thing to do would be to structure your data like so:

CODE | ID1 | ID2
EN | en1 | en2
IT | it1 | it2
FR | fr1 | fr2

Which would produce the following:

{
  "EN" : {
    "CODE" : "EN",
    "ID1" : "en1",
    "ID2" : "en2"
  },
  "IT" : {
    "CODE" : "IT",
    "ID1" : "it1",
    "ID2" : "it2"
  },
  "FR" : {
    "CODE" : "FR",
    "ID1" : "fr1",
    "ID2" : "fr2"
  },
}

There are more rows than columns. It is for localization, each column is a country code, each row is an item to translate.

           EN(English)    IT(Italian)     FR (French)   etc

Item1 .. .. ..
Item2 .. .. ..
ItemX .. .. ..