Reads each symbol on your watchlist from a market-data endpoint you choose and appends the figures to a sheet as a dated row.

UsesGmailGoogle SheetsOpenAI

Log watchlist market figures on a schedule

ScheduleRun every weekday at 17:30.Run every weekday at 17:30.
ValuesSet watchlist to blank.Set watchlist to blank.
ValuesSet quoteUrl to blank.Set quoteUrl to blank.
ValuesSet spreadsheetUrl to blank.Set spreadsheetUrl to blank.
ValuesSet sheetName to Market data log.Set sheetName to Market data log.
ValuesSet emailReportTo to blank.Set emailReportTo to blank.
ValuesSet maxResponseCharacters to 4000.Set maxResponseCharacters to 4000.
Dates & TimesGet the current date and time and save it as recordedAt.Get the current date and time and save it as recordedAt.
Dates & TimesGet today's date and save it as runDate.Get today's date and save it as runDate.
ValuesSet figureLines to an empty list.Set figureLines to an empty list.
ValuesSet skippedLines to an empty list.Set skippedLines to an empty list.
ValuesSet tabCreated to false.Set tabCreated to false.
Decisions & LoopsIf a step below fails, save the error as tabErrorIf a step below fails, save the error as tabError
Try
Google SheetsGoogle SheetsCreate the tab sheetName in spreadsheetUrl.Create the tab sheetName in spreadsheetUrl.
ValuesChange tabCreated to true.Change tabCreated to true.
On error
ValuesShow in the output: Adding rows to the existing '@sheetName' tab.Show in the output: Adding rows to the existing '@sheetName' tab.
Decisions & LoopsIf tabCreated is yesIf tabCreated is yes
Yes
Google SheetsGoogle SheetsAdd a row to sheetName in spreadsheetUrl.Add a row to sheetName in spreadsheetUrl.
No
No steps
TextSplit watchlist by , and save it as symbols.Split watchlist by , and save it as symbols.
Decisions & LoopsFor each rawSymbol in symbols:For each rawSymbol in symbols:
TextMake rawSymbol uppercase and save it as symbol.Make rawSymbol uppercase and save it as symbol.
Decisions & LoopsIf symbol isn't emptyIf symbol isn't empty
Yes
TextReplace SYMBOL with symbol in quoteUrl and save it as requestUrl.Replace SYMBOL with symbol in quoteUrl and save it as requestUrl.
ValuesSet quote to nothing.Set quote to nothing.
ValuesSet problem to blank.Set problem to blank.
Decisions & LoopsIf a step below fails, save the error as quoteErrorIf a step below fails, save the error as quoteError
Try
HTTPFetch requestUrl and save it as quote.Fetch requestUrl and save it as quote.
On error
ValuesChange 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).
Decisions & LoopsIf problem is emptyIf problem is empty
Yes
Decisions & LoopsIf quote.ok isn't yesIf quote.ok isn't yes
Yes
ValuesChange problem to the data source answered HTTP quote.status as text.Change problem to the data source answered HTTP quote.status as text.
No
No steps
No
No steps
ValuesSet answerText to blank.Set answerText to blank.
Decisions & LoopsIf problem is emptyIf problem is empty
Yes
ValuesSet prompt 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.
Decisions & LoopsIf a step below fails, save the error as readErrorIf a step below fails, save the error as readError
Try
OpenAIOpenAIAsk OpenAI: prompt. Save it as reading.Ask OpenAI: prompt. Save it as reading.
TextTrim reading.response_text and save it as answerText.Trim reading.response_text and save it as answerText.
On error
ValuesChange 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).
No
No steps
Decisions & LoopsIf problem is empty and answerText is emptyIf problem is empty and answerText is empty
Yes
ValuesChange problem to the data source response carried no figures to record.Change problem to the data source response carried no figures to record.
No
No steps
Decisions & LoopsIf problem is emptyIf problem is empty
Yes
TextSplit answerText by | and save it as fields.Split answerText by | and save it as fields.
ValuesSet price to blank.Set price to blank.
ValuesSet change to blank.Set change to blank.
ValuesSet currency to blank.Set currency to blank.
ValuesSet figuresAsOf to blank.Set figuresAsOf to blank.
ValuesSet rowNote to Recorded figure - not investment advice..Set rowNote to Recorded figure - not investment advice..
ValuesSet summaryLine to blank.Set summaryLine to blank.
Decisions & LoopsIf the length of fields is 4If the length of fields is 4
Yes
TextTrim fields[0] and save it as price.Trim fields[0] and save it as price.
TextTrim fields[1] and save it as change.Trim fields[1] and save it as change.
TextTrim fields[2] and save it as currency.Trim fields[2] and save it as currency.
TextTrim fields[3] and save it as figuresAsOf.Trim fields[3] and save it as figuresAsOf.
ValuesChange summaryLine to symbol: price currency, change change, as of figuresAsOf.Change summaryLine to symbol: price currency, change change, as of figuresAsOf.
No
ValuesChange 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.
ValuesChange 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.
Decisions & LoopsIf a step below fails, save the error as writeErrorIf a step below fails, save the error as writeError
Try
Google SheetsGoogle SheetsAdd a row to sheetName in spreadsheetUrl.Add a row to sheetName in spreadsheetUrl.
On error
ValuesChange 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).
Decisions & LoopsIf problem is emptyIf problem is empty
Yes
ListsAdd summaryLine to the end of figureLines and save it as figureLines.Add summaryLine to the end of figureLines and save it as figureLines.
No
No steps
No
No steps
Decisions & LoopsIf problem isn't emptyIf problem isn't empty
Yes
ListsAdd symbol - problem to the end of skippedLines and save it as skippedLines.Add symbol - problem to the end of skippedLines and save it as skippedLines.
ValuesShow in the output: Nothing recorded for symbol: problem.Show in the output: Nothing recorded for symbol: problem.
No
No steps
No
No steps
ValuesSet report to blank.Set report to blank.
Decisions & LoopsIf figureLines isn't emptyIf figureLines isn't empty
Yes
ValuesChange report to Watchlist figures recorded at recordedAt:Change report to Watchlist figures recorded at recordedAt: figureLines joined by a new line.
No
ValuesChange report to No figures were recorded at recordedAt.Change report to No figures were recorded at recordedAt.
Decisions & LoopsIf skippedLines isn't emptyIf skippedLines isn't empty
Yes
ValuesChange report to reportChange report to report Not recorded this run: skippedLines joined by a new line.
No
No steps
ValuesChange 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.
ValuesShow in the output: report.Show in the output: report.
Decisions & LoopsIf emailReportTo isn't emptyIf emailReportTo isn't empty
Yes
Decisions & LoopsIf a step below fails, save the error as emailErrorIf a step below fails, save the error as emailError
Try
GmailGmailSend an email to emailReportTo.Send an email to emailReportTo. Subject: Watchlist figures - runDatereport
On error
ValuesShow in the output: The report could not be emailed (emailError.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.
No
No steps