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
Give it a Google Doc of meeting notes, a pasted conference list or a forwarded thread, and run it whenever you like. The AI reads the text and lists every person whose email address or phone number is actually written in it, and each of them becomes a new row on the spreadsheet tab you choose.
Rows are only ever appended, and each records the date, name, email address, phone number, source document and a note. Nothing is invented: every address and number is checked against the document character for character before it is written, and anything not found there is dropped. Addresses are also checked for a valid shape. A name that does not appear the way it was reported is left blank and the note says so. The run ends by saying how many people were offered, written and dropped, and nobody is contacted.
Before the first run you need a spreadsheet tab with the headings 'Found on', 'Name', 'Email', 'Phone', 'Source document' and 'Notes', in that order.
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/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.notesId is emptyIf notesId is emptymaxContacts 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 emptyreadingPrompt 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 emptyreply in lowercase is none or reply in lowercase is none.If reply in lowercase is none or reply in lowercase is none.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 emptycandidates.Add 1 to candidates.contactsWritten is greater than or equal to contactLimitIf contactsWritten is greater than or equal to contactLimitlineText by || and save it as parts.Split lineText by || and save it as parts.parts is not 3If the length of parts is not 3contactsUnreadable.Add 1 to contactsUnreadable.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 emptycontactsRejected.Add 1 to contactsRejected.personEmail isn't empty and not personEmail is a valid email addressIf personEmail isn't empty and not personEmail is a valid email addresscontactsRejected.Add 1 to contactsRejected.personEmail isn't empty and sourceText doesn't contain personEmail (ignoring…If personEmail isn't empty and sourceText doesn't contain personEmail (ignoring…contactsRejected.Add 1 to contactsRejected.personPhone isn't empty and sourceText doesn't contain personPhone (ignoring…If personPhone isn't empty and sourceText doesn't contain personPhone (ignoring…contactsRejected.Add 1 to contactsRejected.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…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..writeErrorIf a step below fails, save the error as writeErrortabName in spreadsheetUrl.Add a row to tabName in spreadsheetUrl.contactsWritten.Add 1 to contactsWritten.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 candidatesrunSummary.Finish the run: runSummary.runSummary.Show in the output: runSummary.