Question Using write-json to generate json from prodataset

Potish

Member
I am developing a program to generate json from a dataset that includes several nested temp-tables. When I write the output, the nested temp-tables are written as array objects - something like -> dataLoader": [{"url": "data/266m.csv", "format": "csv", ...}]. Larger json example is below

Code:
{
  "chartdiv": [
    {
      "theme": "light",
      "dataDateFormat": "YYYY-MM-DD",
      "dataSets": [
        {
          "title": "Daily Close Price",
          "compared": false,
          "fieldMappings": [
            {
              "fromField": "Date",
              "toField": "date"
            },
            {
              "fromField": "Open",
              "toField": "open"
            },
            {
              "fromField": "High",
              "toField": "high"
            },
            {
              "fromField": "Low",
              "toField": "low"
            },
            {
              "fromField": "Close",
              "toField": "close"
            },
            {
              "fromField": "Volume",
              "toField": "volume"
            }
          ],
          "dataLoader": [
            {
              "url": "data/266m.csv",
              "format": "csv",
              "showCurtain": true,
              "showErrors": true,
              "async": true,
              "reverse": true,
              "delimiter": ",",
              "useColumnNames": true
            }
          ]
        },........

However I need to generate some of these nested tables such as the one under dataLoader above as a object without the array - so just as "dataLoader": {"url": "data/266m.csv", "format": "csv", ...}" as there is only 1 table row in the dataset for this object and the system utilizing the json errors out when it is passed as a array object. Is it possible to do this with the write-json and prodataset?
 
Top