{"id":"code-work-hr-build-work-emails","audience":"hr","category":"coding","track":"coding","technique":"examples","title":"Build new hires' work emails from their names","free":false,"task":"Write one Google Sheets formula for C2 (filled down) that builds each new hire's work email from first name (A2) and last name (B2): first initial plus last name, all lowercase, with spaces, hyphens and apostrophes removed from the last name, at fernbrook.example. For example Pat O'Neil becomes poneil@fernbrook.example. One formula in one code block, then under 25 words outside the code.","materialLabel":"New hire list (attached to your prompt automatically)","material":"NEW HIRES - December start class (row 1 is headers)\nA First | B Last | C Work email | D Start\nPat | O'Neil | ? | 12/01\nAna | Garcia Lopez | ? | 12/01\nMei-Lin | Wu | ? | 12/01\nJordan | Smith-Baker | ? | 12/08\nSam | Delacroix | ? | 12/08\n\nNotes from Gwen:\n- IT creates the accounts from column C the Friday before each start date.\n- Email addresses can't contain spaces or punctuation besides the @ and the dot.\n- If two people end up with the same email, IT adds a number by hand.\n- Our old domain was fernbrookdental.example; we switched in July.\n- Mei-Lin goes by Mei-Lin, so her initial is M.","rules":[{"type":"codeBlocks","count":1},{"type":"maxProseWords","max":25}],"mistakes":[{"title":"Not showing an example","why":"The AI guesses the pattern, like first.last.","fix":"Add: \"Pat O'Neil becomes poneil@fernbrook.example.\"","checks":["r0"]},{"title":"Forgetting punctuation","why":"The AI keeps the apostrophe and the hyphen, which emails can't have.","fix":"Add: \"Remove spaces, hyphens and apostrophes, all lowercase.\"","checks":["r1"]},{"title":"Not giving the domain","why":"The AI picks the old domain from the notes or invents one.","fix":"Add: \"Domain is fernbrook.example.\"","checks":["r2"]},{"title":"Getting a menu of options","why":"The AI likes to offer two or three versions of the formula, so you're left to pick and test them yourself.","fix":"Add: \"Give one formula only, in one code block, no alternatives.\"","checks":["codeBlocks"]},{"title":"Getting a tutorial","why":"By default the AI explains every part of the code at length, which you then have to scroll past.","fix":"Add: \"After the code, one line under 10 words. Nothing else.\"","checks":["maxProseWords"]}],"promptHints":[{"label":"Shows an example","patterns":["poneil","becomes","for example|e\\.g\\."]},{"label":"Removes punctuation","patterns":["apostroph","hyphen","spaces","punctuation"]},{"label":"Gives the domain","patterns":["fernbrook\\.example"]},{"label":"Asks for one answer only","patterns":["\\b(one|single|1)\\s+(formula|code block|block|version)","only one","no (alternatives|options|other versions)"]},{"label":"Limits the explanation","patterns":["\\d+\\s*words","no (explanation|notes|commentary)","one (short )?(line|sentence)","nothing else"]}],"hint":"One worked example tells the AI the whole pattern. Pick a tricky name like O'Neil and show what it becomes.","rubricLabels":["Uses the first letter of A2 plus the last name in B2, so Ana Garcia Lopez becomes agarcialopez","Removes spaces, hyphens and apostrophes from the last name (for example REGEXREPLACE(B2,\"[^A-Za-z]\",\"\")) and lowercases the result, so O'Neil gives oneil","Ends with @fernbrook.example (not the old fernbrookdental.example)"]}