Reads a page of notes and adds a row for every name, email address and phone number actually written in it.
Uses
Claude
Google Docs
Google Sheets
Pull the contact details out of your notes
notesDocument to blank.Set notesDocument to blank.spreadsheetUrl to blank.Set spreadsheetUrl to blank.tabName to blank.Set tabName to blank.maxContacts to 50.Set maxContacts to 50.notesDocument and save it as documentLink.Trim notesDocument and save it as documentLink.notesId to documentLink.Set notesId to documentLink.documentLink contains /d/If documentLink contains /d/Yes
documentLink split by /d/ split by / and save it as notesId.Get the first item of the last item of documentLink split by /d/ split by / and save it as notesId.Else if @documentLink contains "/"
Otherwise
No steps
notesId is emptyIf notesId is emptyYes
No
No steps
maxContacts multiplied by 1 to the nearest integer and save it as contactLimit.Round maxContacts multiplied by 1 to the nearest integer and save it as contactLimit.notesId. Save it as notes.Read notesId. Save it as notes.notes.text and save it as sourceText.Trim notes.text and save it as sourceText.sourceText is null or sourceText is emptyIf sourceText is null or sourceText is emptyYes
No
No steps
readingPrompt to You are reading one document and listing only the people whose contact details are written in it.Set readingPrompt to You are reading one document and listing only the people whose contact details are written in it.
Rules:
- Copy characters exactly as they appear in the text. Never correct, complete, reformat, tidy, guess or invent any part of a name, email address or phone number.
- Include a person only if the text itself contains their email address or their phone number.
- Return one person per line, in this form: name || email address || phone number
- Keep both || separators on every line, even when a part is missing. Leave a part empty rather than filling it in.
- Do not add a heading, numbering, explanation or any other text.
- If the text contains no email addresses and no phone numbers, reply with the single word none.
Text:
sourceText.readingPrompt. Save it as reading.Ask Claude: readingPrompt. Save it as reading.
Maximum response length: 2000reading.response_text and save it as reply.Trim reading.response_text and save it as reply.reply is null or reply is emptyIf reply is null or reply is emptyYes
No
No steps
reply in lowercase is none or reply in lowercase is none.If reply in lowercase is none or reply in lowercase is none.Yes
No
No steps
candidates to 0.Set candidates to 0.contactsWritten to 0.Set contactsWritten to 0.contactsRejected to 0.Set contactsRejected to 0.contactsUnreadable to 0.Set contactsUnreadable to 0.contactsFailed to 0.Set contactsFailed to 0.replyLine in reply split by a new line:For each replyLine in reply split by a new line:replyLine and save it as lineText.Trim replyLine and save it as lineText.lineText is null or lineText is emptyIf lineText is null or lineText is emptyYes
No
No steps
candidates.Add 1 to candidates.contactsWritten is greater than or equal to contactLimitIf contactsWritten is greater than or equal to contactLimitYes
No
No steps
lineText by || and save it as parts.Split lineText by || and save it as parts.parts is not 3If the length of parts is not 3Yes
contactsUnreadable.Add 1 to contactsUnreadable.No
No steps
parts[0] and save it as personName.Trim parts[0] and save it as personName.parts[1] and save it as personEmail.Trim parts[1] and save it as personEmail.parts[2] and save it as personPhone.Trim parts[2] and save it as personPhone.personEmail is empty and personPhone is emptyIf personEmail is empty and personPhone is emptyYes
contactsRejected.Add 1 to contactsRejected.No
No steps
personEmail isn't empty and not personEmail is a valid email addressIf personEmail isn't empty and not personEmail is a valid email addressYes
contactsRejected.Add 1 to contactsRejected.No
No steps
personEmail isn't empty and sourceText doesn't contain personEmail (ignoring…If personEmail isn't empty and sourceText doesn't contain personEmail (ignoring…Yes
contactsRejected.Add 1 to contactsRejected.No
No steps
personPhone isn't empty and sourceText doesn't contain personPhone (ignoring…If personPhone isn't empty and sourceText doesn't contain personPhone (ignoring…Yes
contactsRejected.Add 1 to contactsRejected.No
No steps
rowNote to blank.Set rowNote to blank.personName isn't empty and sourceText doesn't contain personName (ignoring…If personName isn't empty and sourceText doesn't contain personName (ignoring…Yes
personName to blank.Change personName to blank.rowNote to The name was not written this way in the document, so it has been left blank..Change rowNote to The name was not written this way in the document, so it has been left blank..No
No steps
writeErrorIf a step below fails, save the error as writeErrorTry
tabName in spreadsheetUrl.Add a row to tabName in spreadsheetUrl.contactsWritten.Add 1 to contactsWritten.On error
contactsFailed.Add 1 to contactsFailed.writeError as text.Show in the output: A contact could not be written to the spreadsheet: writeError as text.runSummary to contactsWritten contacts were written from candidates the reader offered. contactsRejected were dropped because their details were not in the document, contactsUnreadable could not be read and contactsFailed failed to write.Set runSummary to contactsWritten contacts were written from candidates the reader offered. contactsRejected were dropped because their details were not in the document, contactsUnreadable could not be read and contactsFailed failed to write.contactsWritten is less than candidatesIf contactsWritten is less than candidatesYes
runSummary.Finish the run: runSummary.No
runSummary.Show in the output: runSummary.