Reads each symbol on your watchlist from a market-data endpoint you choose and appends the figures to a sheet as a dated row.
Uses
Gmail
Google Sheets
OpenAI
Log watchlist market figures on a schedule
Every weekday at 17:30, the workflow reads each symbol on your watchlist from a market data endpoint you choose and adds one dated row per symbol to a Google Sheet: the time recorded, the price, the change, the currency and the data source's own timestamp. Rows are appended, never overwritten, so the sheet becomes a history you can chart.
It records data and nothing else. It will not tell you to buy, sell or hold and gives no rating or forecast, and every row carries a note saying the figures are recorded, not advice. The only AI step is a transcriber, told not to estimate, convert, compare or comment. A reply that does not come back as those four fields is kept verbatim in the notes column with the figures left empty, so a price is never invented. A symbol whose endpoint fails is named in the report and skipped, and the rest is still recorded.
You supply the data source, and any key in its address never reaches the sheet. The plain run report can also be emailed to you.
watchlist to blank.Set watchlist to blank.quoteUrl to blank.Set quoteUrl to blank.spreadsheetUrl to blank.Set spreadsheetUrl to blank.sheetName to Market data log.Set sheetName to Market data log.emailReportTo to blank.Set emailReportTo to blank.maxResponseCharacters to 4000.Set maxResponseCharacters to 4000.recordedAt.Get the current date and time and save it as recordedAt.runDate.Get today's date and save it as runDate.figureLines to an empty list.Set figureLines to an empty list.skippedLines to an empty list.Set skippedLines to an empty list.tabCreated to false.Set tabCreated to false.tabErrorIf a step below fails, save the error as tabErrorsheetName in spreadsheetUrl.Create the tab sheetName in spreadsheetUrl.tabCreated to true.Change tabCreated to true.tabCreated is yesIf tabCreated is yessheetName in spreadsheetUrl.Add a row to sheetName in spreadsheetUrl.watchlist by , and save it as symbols.Split watchlist by , and save it as symbols.rawSymbol in symbols:For each rawSymbol in symbols:rawSymbol uppercase and save it as symbol.Make rawSymbol uppercase and save it as symbol.symbol isn't emptyIf symbol isn't emptySYMBOL with symbol in quoteUrl and save it as requestUrl.Replace SYMBOL with symbol in quoteUrl and save it as requestUrl.quote to nothing.Set quote to nothing.problem to blank.Set problem to blank.quoteErrorIf a step below fails, save the error as quoteErrorrequestUrl and save it as quote.Fetch requestUrl and save it as quote.problem to the data source could not be reached (quoteError.message with requestUrl replaced by the endpoint address).Change problem to the data source could not be reached (quoteError.message with requestUrl replaced by the endpoint address).problem is emptyIf problem is emptyquote.ok isn't yesIf quote.ok isn't yesproblem to the data source answered HTTP quote.status as text.Change problem to the data source answered HTTP quote.status as text.answerText to blank.Set answerText to blank.problem is emptyIf problem is emptyprompt to You are transcribing figures out of one market-data response. Report only what the response below actually contains.Set prompt to You are transcribing figures out of one market-data response. Report only what the response below actually contains.
Do not estimate, forecast, convert, annualise or round any figure. Do not add a figure the response does not state. Do not say whether the number is high, low, good or bad, do not compare it to anything, and do not give a view on the security or on what anyone should do - this is a record of numbers, not analysis.
Reply with exactly one line and nothing else: four fields separated by the | character, in this order:
price | change | currency | as of
Copy each figure exactly as the response gives it. Use the single word unknown for any of the four the response does not state. Write no other text, no explanation and no units beyond what is already in the figure.
Symbol: symbol
Response from the data source:
quote.body as text truncated to maxResponseCharacters characters.readErrorIf a step below fails, save the error as readErrorprompt. Save it as reading.Ask OpenAI: prompt. Save it as reading.reading.response_text and save it as answerText.Trim reading.response_text and save it as answerText.problem to the figures could not be read out of the response (readError.message).Change problem to the figures could not be read out of the response (readError.message).problem is empty and answerText is emptyIf problem is empty and answerText is emptyproblem to the data source response carried no figures to record.Change problem to the data source response carried no figures to record.problem is emptyIf problem is emptyanswerText by | and save it as fields.Split answerText by | and save it as fields.price to blank.Set price to blank.change to blank.Set change to blank.currency to blank.Set currency to blank.figuresAsOf to blank.Set figuresAsOf to blank.rowNote to Recorded figure - not investment advice..Set rowNote to Recorded figure - not investment advice..summaryLine to blank.Set summaryLine to blank.fields is 4If the length of fields is 4fields[0] and save it as price.Trim fields[0] and save it as price.fields[1] and save it as change.Trim fields[1] and save it as change.fields[2] and save it as currency.Trim fields[2] and save it as currency.fields[3] and save it as figuresAsOf.Trim fields[3] and save it as figuresAsOf.summaryLine to symbol: price currency, change change, as of figuresAsOf.Change summaryLine to symbol: price currency, change change, as of figuresAsOf.rowNote to No figures were taken: the data source reply did not come back as price, change, currency and as-of. Reply was: answerText truncated to 300 characters -- Recorded figure - not investment advice.Change rowNote to No figures were taken: the data source reply did not come back as price, change, currency and as-of. Reply was: answerText truncated to 300 characters -- Recorded figure - not investment advice.summaryLine to symbol: no figures could be read from the data source reply; it is kept in the sheet.Change summaryLine to symbol: no figures could be read from the data source reply; it is kept in the sheet.writeErrorIf a step below fails, save the error as writeErrorsheetName in spreadsheetUrl.Add a row to sheetName in spreadsheetUrl.problem to the row could not be added to the sheet (writeError.message).Change problem to the row could not be added to the sheet (writeError.message).problem is emptyIf problem is emptysummaryLine to the end of figureLines and save it as figureLines.Add summaryLine to the end of figureLines and save it as figureLines.problem isn't emptyIf problem isn't emptysymbol - problem to the end of skippedLines and save it as skippedLines.Add symbol - problem to the end of skippedLines and save it as skippedLines.symbol: problem.Show in the output: Nothing recorded for symbol: problem.report to blank.Set report to blank.figureLines isn't emptyIf figureLines isn't emptyreport to Watchlist figures recorded at recordedAt:Change report to Watchlist figures recorded at recordedAt:
figureLines joined by a new line.report to No figures were recorded at recordedAt.Change report to No figures were recorded at recordedAt.skippedLines isn't emptyIf skippedLines isn't emptyreport to reportChange report to report
Not recorded this run:
skippedLines joined by a new line.report to reportChange report to report
These are recorded figures only. They were transcribed from the data source set up in this workflow, have not been checked against an exchange or a broker, and are not investment advice - no recommendation is intended or implied.report.Show in the output: report.emailReportTo isn't emptyIf emailReportTo isn't emptyemailErrorIf a step below fails, save the error as emailErroremailReportTo.Send an email to emailReportTo.
Subject: Watchlist figures - runDatereportemailError.message); the rows are in the sheet.Show in the output: The report could not be emailed (emailError.message); the rows are in the sheet.