Every hour, has ChatGPT write a fresh batch of the list you describe and adds each item as a row in your Google Sheet.
Uses
Google Sheets
OpenAI
Fill a spreadsheet with a ChatGPT-written list every hour
request to blank.Set request to blank.columns to blank.Set columns to blank.itemsPerRun to 5.Set itemsPerRun to 5.spreadsheetUrl to blank.Set spreadsheetUrl to blank.sheetName to Sheet1.Set sheetName to Sheet1.prompt to You are producing rows for a spreadsheet.Set prompt to You are producing rows for a spreadsheet.
Produce exactly itemsPerRun items. Each item is: request
Reply with a JSON array and nothing else: no introduction, no explanation and no Markdown code fences. Every element of the array is a JSON object with exactly these keys, spelled exactly as written and in this order: columns
Every value is plain text or a number - never an object or a list, and never left empty. Do not include the same item twice.prompt. Save it as answer.Ask OpenAI: prompt. Save it as answer.reply, columns, items_per_run, and generated_at and save it as parsed.Run Python code on reply, columns, items_per_run, and generated_at and save it as parsed.rows to parsed.rows.Set rows to parsed.rows.rows is emptyIf rows is emptyYes
parsed.problem.Stop and report a problem: No rows were added. parsed.problem.No
No steps
rowsAdded to 0.Set rowsAdded to 0.row in rows:For each row in rows:sheetErrorIf a step below fails, save the error as sheetErrorTry
sheetName in spreadsheetUrl.Add a row to sheetName in spreadsheetUrl.rowsAdded.Add 1 to rowsAdded.On error
rowsAdded of the length of rows row(s) to '@sheetName' before Google Sheets refused one. The remaining items from this batch were not added; once the sheet or its link is fixed, the next run adds a fresh batch. Google Sheets said: sheetError.message.Stop and report a problem: Added rowsAdded of the length of rows row(s) to '@sheetName' before Google Sheets refused one. The remaining items from this batch were not added; once the sheet or its link is fixed, the next run adds a fresh batch. Google Sheets said: sheetError.message.rowsAdded row(s) to '@sheetName'.Show in the output: Added rowsAdded row(s) to '@sheetName'.parsed.note isn't emptyIf parsed.note isn't emptyYes
parsed.note.Show in the output: parsed.note.No
No steps