ExportIntoWorkbook
  • 1 Minute to read
  • Dark
    Light
  • PDF

ExportIntoWorkbook

  • Dark
    Light
  • PDF

Article summary

Overview


Example

{
  "method": "ExportIntoWorkbook",
  "project": "ExcelFileLoad",
  "filename": "%OUTPUT%workbook.xlsx",
  "xlTemplate": "%OUTPUT%template.xlsx",
  "startRow":3,
  "sheet":"owid",
  "includeHeaders":false,
  "fields": [
    "superstore.Customer ID",
    "superstore.Customer Name",
    "superstore.Order Date",
    "superstore.Ship Date",
    "superstore.Ship Mode",
    "superstore.Sales",
    "superstore.Profit",
    "superstore.Shipping Cost",
    "superstore.Postal Code"
  ],
  "dataSet": {
    "logic": "or",
    "name": "SubSet",
    "strict": true,
    "set": [
      {
        "logic": "or",
        "stype": "TABLE",
        "entity": "superstore"
      }
    ]
  }
}





Iterator

Including an iterator entry in the call will produce an output file for each of the values in the iterator field.

The filename is created from the indicated file + validated field value name.

"iterator": {
    "field": "customer.name",
    "includeNull" : false
  }

If the JSON contains a dataSet then each of the field's values is logically ANDed with this dataset before export.

The call will return a list of values and paths in the files key.

"files": [
    {
      "value": "First Class",
      "path": "%OUTPUT%output_firstclass.xlsx"
    },
    {
      "value": "Same Day",
      "path": "%OUTPUT%output_sameday.xlsx"
    },
    {
      "value": "Second Class",
      "path": "%OUTPUT%output_secondclass.xlsx"
    }
  ]

Append (4.3.3.1)

Added JSON key  "append" : true(false)

if "append" is true, a new sheet with the declared "sheet" name will be added to the existing workbook.

Append (4.3.7.1)

Added JSON Key "ignoreIfNoSourceTable" :  false(true)

If true, will not throw an error if the dataset refers to a table that does not exist 


Was this article helpful?

What's Next