Researches each new line on a client's bank feed sheet and writes who was paid, what they do and where to post it, with sources.
Uses
Google Sheets
Identify who was paid on every bank feed line
sheetUrl to blank.Set sheetUrl to blank.feedTab to Bank feed.Set feedTab to Bank feed.resultsTab to Vendor research.Set resultsTab to Vendor research.clientName to blank.Set clientName to blank.clientNotes to blank.Set clientNotes to blank.maxLinesPerRun to 10.Set maxLinesPerRun to 10.checkedOn.Get today's date and save it as checkedOn.headings to [Checked on, Bank line, Date, Amount, Status, Vendor, Website, What they do, Likely reason, Suggested account, Confidence, Independent check, Summary, Evidence, Sources, Ask the client].Set headings to [Checked on, Bank line, Date, Amount, Status, Vendor, Website, What they do, Likely reason, Suggested account, Confidence, Independent check, Summary, Evidence, Sources, Ask the client].alreadyChecked to an empty list.Set alreadyChecked to an empty list.resultsTabErrorIf a step below fails, save the error as resultsTabErrorTry
sheetUrl. Save it as done.Read the rows of sheetUrl. Save it as done.done.headers is emptyIf done.headers is emptyYes
resultsTab in sheetUrl.Add a row to resultsTab in sheetUrl.No
No steps
done.headers isn't empty and done.headers doesn't contain Bank lineIf done.headers isn't empty and done.headers doesn't contain Bank lineYes
No
No steps
doneRow in done.rows:For each doneRow in done.rows:doneRow["Bank line"] and save it as doneLine. Trim doneRow["Bank line"] and save it as doneLine.doneLine isn't empty and doneLine is not null If doneLine isn't empty and doneLine is not nullYes
doneLine to the end of alreadyChecked and save it as alreadyChecked.Add doneLine to the end of alreadyChecked and save it as alreadyChecked.No
No steps
On error
createTabErrorIf a step below fails, save the error as createTabErrorTry
resultsTab in sheetUrl.Create the tab resultsTab in sheetUrl.resultsTab in sheetUrl.Add a row to resultsTab in sheetUrl.On error
sheetUrl. Save it as feed.Read the rows of sheetUrl. Save it as feed.feed.headers is emptyIf feed.headers is emptyYes
No
No steps
feed.headers doesn't contain DescriptionIf feed.headers doesn't contain DescriptionYes
feed.headers with , and save it as feedHeadings.Join feed.headers with , and save it as feedHeadings.feedHeadings. Rename the column that holds the bank's wording for each line to Description (Date and Amount are used too when the tab has them), then run it again.Stop and report a problem: The '@feedTab' tab has no column headed Description, so there is no bank line to research. Its headings are: feedHeadings. Rename the column that holds the bank's wording for each line to Description (Date and Amount are used too when the tab has them), then run it again.No
No steps
checked to 0.Set checked to 0.succeeded to 0.Set succeeded to 0.failed to 0.Set failed to 0.skipped to 0.Set skipped to 0.linesLeft to an empty list.Set linesLeft to an empty list.line in feed.rows:For each line in feed.rows:line.Description and save it as description.Trim line.Description and save it as description.description is blank or description is nullIf description is blank or description is nullYes
No
No steps
alreadyChecked contains descriptionIf alreadyChecked contains descriptionYes
skipped.Add 1 to skipped.No
No steps
checked is greater than or equal to maxLinesPerRunIf checked is greater than or equal to maxLinesPerRunYes
linesLeft doesn't contain descriptionIf linesLeft doesn't contain descriptionYes
description to the end of linesLeft and save it as linesLeft.Add description to the end of linesLeft and save it as linesLeft.No
No steps
No
No steps
checked.Add 1 to checked.line.Date and save it as dateText.Trim line.Date and save it as dateText.dateText is nullIf dateText is nullYes
dateText to blank.Change dateText to blank.No
No steps
line.Amount and save it as amountText.Trim line.Amount and save it as amountText.amountText is nullIf amountText is nullYes
amountText to blank.Change amountText to blank.No
No steps
hint to blank.Set hint to blank.dateText isn't emptyIf dateText isn't emptyYes
hint to Dated dateText.Change hint to Dated dateText.No
No steps
amountText isn't emptyIf amountText isn't emptyYes
hint to hintAmount amountText.Change hint to hintAmount amountText.No
No steps
lineErrorIf a step below fails, save the error as lineErrorTry
Verify the vendor behind a bank or card line workflow with bankLine, whatYouKnow, clientName, and clientNotes and save it as result.Run the Verify the vendor behind a bank or card line workflow with bankLine, whatYouKnow, clientName, and clientNotes and save it as result.resultsTab in sheetUrl.Add a row to resultsTab in sheetUrl.succeeded.Add 1 to succeeded.On error
succeeded is 0If succeeded is 0Yes
lineError.message). Nothing was written for it, so it is tried again on the next run. If the message says the workflow to run is missing, open this workflow's 'Run a workflow' step and choose 'Verify the vendor behind a bank or card line'; that workflow needs Serper, Exa and OpenAI connected.Stop and report a problem: Stopped before writing anything: '@description' could not be researched and recorded (lineError.message). Nothing was written for it, so it is tried again on the next run. If the message says the workflow to run is missing, open this workflow's 'Run a workflow' step and choose 'Verify the vendor behind a bank or card line'; that workflow needs Serper, Exa and OpenAI connected.No
No steps
failed.Add 1 to failed.lineError.message as text.Show in the output: Could not research '@description': lineError.message as text.resultsTab in sheetUrl.Add a row to resultsTab in sheetUrl.description to the end of alreadyChecked and save it as alreadyChecked.Add description to the end of alreadyChecked and save it as alreadyChecked.linesLeft and save it as leftCount.Count the items in linesLeft and save it as leftCount.reportLines to an empty list.Set reportLines to an empty list.succeeded new line(s) and wrote them to the '@resultsTab' tab; skipped line(s) were already there. to the end of reportLines and save it as reportLines.Add Researched succeeded new line(s) and wrote them to the '@resultsTab' tab; skipped line(s) were already there. to the end of reportLines and save it as reportLines.leftCount is greater than 0If leftCount is greater than 0Yes
leftCount more line(s) are waiting: each run checks at most maxLinesPerRun, so run it again for the rest. to the end of reportLines and save it as reportLines.Add leftCount more line(s) are waiting: each run checks at most maxLinesPerRun, so run it again for the rest. to the end of reportLines and save it as reportLines.No
No steps
failed is greater than 0If failed is greater than 0Yes
failed line(s) could not be researched and are on the tab as 'Could not research' with the reason; delete such a row to have that line tried again. to the end of reportLines and save it as reportLines.Add failed line(s) could not be researched and are on the tab as 'Could not research' with the reason; delete such a row to have that line tried again. to the end of reportLines and save it as reportLines.No
No steps
reportLines with a space and save it as runSummary.Join reportLines with a space and save it as runSummary.failed is greater than 0If failed is greater than 0Yes
runSummary.Stop and report a problem: runSummary.No
No steps
runSummary.Finish the run: runSummary.