Sheetfast generation payload examples

Sheetfast generation payload examples

Multiple Sheets

{
  "sheets": [
    {
      "name": "Sheet name 1",
      "rows": [
        {
          "id": 2464554,
          "bonus": "SSD Externe 1 To"
        },
        {
          "id": 2419927,
          "bonus": "SSD Externe 2 To"
        },
        {
          "id": 2464555,
          "bonus": "Computer"
        }
      ]
    },
    {
      "name": "Sheet name 2",
      "rows": [
        {
          "id": 2464555,
          "bonus": "SSD Externe 2 To"
        },
        {
          "id": 2419928,
          "bonus": "SSD Externe 2 To"
        }
      ]
    }
  ]
}

Single Sheets with Title

{
  "options": {
    "headers": {
      "participationStatus": "Status Participation"
    },
    "removeHeaderRow": false,
    "CSVDelimiter": ";"
  },
  "sheets": [
    {
      "name": "SHITFAST",
      "options": {
        "title": "The Shitfast example"
      },
      "rows": [
        {
          "city": "Prout",
          "size": "XXL"
        },
        {
          "city": "Boum",
          "bonus": "S"
        }
      ]
    }
  ]
}

JSON formatter

Input

{
  "sheets": [
    {
      "name": "Sample Sheet",
      "rows": [
        {
          "id": 1,
          "details": { "name": "Alice", "age": 30 },
          "scores": [10, 20]
        },
        {
          "id": 2,
          "details": { "name": "Bob", "age": 25 },
          "scores": [30, 40]
        },
        {
          "id": 3,
          "details": { "name": "Charlie", "age": 35 },
          "scores": [50, 60]
        }
      ],
      "options": {
        "headers": {
          "id": "ID",
          "details": "Details",
          "scores": "Scores"
        },
        "formatters": {
          "details": "json",
          "scores": "json"
        }
      }
    }
  ]
}

Output

iddetailsscores
1{"name": "Alice", "age": 30}10, 20
2{"name": "Bob", "age": 25}30, 40
3{"name": "Charlie", "age": 35}50, 60

Understood. Here’s an example where the input dates are in ISO 8601 string format, and they will be formatted into three different date formats.

Date Formatter

Input

{
  "sheets": [
    {
      "name": "Date Format Sheet",
      "rows": [
        {
          "id": 1,
          "date_col1": "2023-07-01T12:00:00Z",
          "date_col2": "2023-07-01T12:00:00Z",
          "date_col3": "2023-07-01T12:00:00Z",
          "date_col4": "2023-07-01T12:00:00Z"
        },
        {
          "id": 2,
          "date_col1": "2023-08-15T08:30:00Z",
          "date_col2": "2023-08-15T08:30:00Z",
          "date_col3": "2023-08-15T08:30:00Z",
          "date_col4": "2023-08-15T08:30:00Z"
        },
        {
          "id": 3,
          "date_col1": "2024-01-10T18:45:00Z",
          "date_col2": "2024-01-10T18:45:00Z",
          "date_col3": "2024-01-10T18:45:00Z",
          "date_col4": "2024-01-10T18:45:00Z"
        }
      ],
      "options": {
        "formatters": {
          "date_col1": "date::%d/%m/%Y",
          "date_col2": "date::%m-%d-%Y",
          "date_col3": "date::%Y/%m/%d",
          "date_col4": "date::%Y-%m-%d %H:%M"
        }
      }
    }
  ],
  "options": {
    "filename": "date_format_example"
  }
}

Output

iddate_col1date_col2date_col3date_col4
101/07/202307-01-20232023/07/012023-07-01 12:00
215/08/202308-15-20232023/08/152023-08-15 08:30
310/01/202401-10-20242024/01/102024-01-10 18:45