Frosts

pandas-inspired Excel scripting for Office Scripts


Project maintained by JoeyRussoniello Hosted on GitHub Pages — Theme by mattgraham

📤 Exporting and Output Options

Once your data is prepared and processed, you’ll often want to save it for later use or share it with other systems. Frosts makes it easy to export your DataFrames to common formats like Excel, CSV, and JSON, and just as simple to load them back in.

Table of Contents

  1. to_worksheet()
  2. to_json()
  3. to_csv()
  4. to_array()

to_worksheet(worksheet:ExcelScript.Worksheet, method: (“o”|”a”) = “o”)

Writes the DataFrame directly into an Excel worksheet.

✅ Use When: You’re working output/save results directly into Excel, incredibly useful for PowerBI tools and automation.

Example:

df.to_worksheet(workbook.getWorksheet("Results"), "o");

This will overwrite the “Results” sheet with the DataFrame.

to_json(headers:boolean = true):string

Exports the DataFrame as a JSON string.

âś… Use When:

console.log(df.to_json());
//Output: [["Name","Score"],["Alice",95],["Bob",87]]

Or without headers

console.log(df.to_json(false));
//Output: [["Alice",95],["Bob",87]]

PROVIDE AN OUTPUT HERE

to_csv(headers:boolean = true, separator:string = “,”):string

Converts the DataFrame to a CSV-formatted string.

âś… Use When:

Example:

const csv = df.to_csv(true, ",");

Example Output change to table

Name Score
Alice 95
Bob 87

This method can also be used to convert to TSV or any other separator

df.to_csv(true,"\t");

to_array(headers: boolean = true): (string | number | boolean)[][]

Returns the DataFrame as a 2D array (array of rows), optionally including headers.

âś… Use When:

Example:

const data = df.to_array();

Sample Output

[
  ["Name", "Score"],
  ["Alice", 95],
  ["Bob", 87]
]

You can also choose to omit headers

const data_no_headers = df.to_array(false);

You’ve now mastered everything frosts, and you’re ready to start building PowerAutomate pipelines and Javascript workflows!

Return to API Reference