API Data to Excel
Fetch data from REST API and save to Excel file
Steps
| # | Activity | What it does |
|---|---|---|
| 1 | HttpRequest | Call the API endpoint |
| 2 | CreateTable | Create an in-memory table for the API rows |
| 3 | ForEachLoop | Iterate over the API response items |
| 4 | TableUpsertRow | Append each item to the table |
| 5 | TableExport | Export the rows to Excel |
Workflow
apiResponse = HttpRequest("https://api.example.com/data", "GET")
CreateTable("apiData", schema={"columns": [{"name": "id"}, {"name": "name"}, {"name": "value"}]})
for item in apiResponse.items:
TableUpsertRow("apiData", {"id": "{{ item.id }}", "name": "{{ item.name }}", "value": "{{ item.value }}"}, append=True)
TableExport("apiData", "./output.xlsx", format="xlsx", sheetName="Data")