{"id":"code-work-re-apps-script-showing-events","audience":"real-estate","category":"coding","track":"coding","technique":"constraints","title":"Turn a showings sheet into calendar events","free":false,"task":"Write a Google Apps Script function named addShowings that reads the Showings tab (header in row 1) and, for each row whose Scheduled column (E) is empty, creates a 30-minute event on the team calendar with ID showings@alderfinch.example, titled exactly Showing: <address> - <buyer>, starting at the date-time in C. Then write Yes in E. Don't invite or email anyone: no guests and no invites. One code block, at most 14 lines, then under 25 words outside the code.","materialLabel":"Showings tab preview (attached to your prompt automatically)","material":"SHOWINGS tab - Alder & Finch Realty (row 1 is headers)\nA Address | B Buyer | C Start (date and time) | D Agent | E Scheduled\n14 Alder Ln | Okafor | 11/14/2026 10:00 | Nina | \n301 Fir St | Okafor | 11/14/2026 11:00 | Nina | \n88 Cedar Row #4 | Delgado | 11/15/2026 13:30 | Sam | Yes\n76 Ash Way | Lindqvist | 11/15/2026 15:00 | Sam | \n\nNotes from Nina (team lead):\n- Every showing is 30 minutes, door to door.\n- Buyers get a text from the agent, not a calendar invite.\n- The team calendar is shared with the office assistant.\n- Listing agents confirm access through the lockbox app.\n- We add about 20 showings a week.","rules":[{"type":"codeBlocks","count":1},{"type":"maxCodeLines","max":14},{"type":"maxProseWords","max":25}],"mistakes":[{"title":"Not naming the calendar","why":"The AI uses your default calendar, so the team never sees the showings.","fix":"Add: \"Use getCalendarById(\\\"showings@alderfinch.example\\\").\"","checks":["r0"]},{"title":"Forgetting what's already booked","why":"The AI creates every row again each time you run it.","fix":"Add: \"Only rows where E is empty, then write Yes in E.\"","checks":["r1"]},{"title":"Not ruling out invites","why":"The AI adds buyers as guests and sends invites, which they don't expect.","fix":"Add: \"No guests, no invites, no email.\"","checks":["r2"]},{"title":"Getting a menu of options","why":"The AI likes to offer two or three versions of the script, so you're left to pick and test them yourself.","fix":"Add: \"Give one script only, in one code block, no alternatives.\"","checks":["codeBlocks","maxCodeLines"]},{"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 12 words. Nothing else.\"","checks":["maxProseWords"]}],"promptHints":[{"label":"Names the calendar","patterns":["showings@alderfinch","calendar id","getcalendarbyid"]},{"label":"Gives the title","patterns":["showing: ","title"]},{"label":"Skips booked rows","patterns":["empty|blank","write yes","scheduled"]},{"label":"Rules out invites","patterns":["no (guests|invites?|email)","don'?t invite"]},{"label":"Caps the code length","patterns":["\\d+\\s*lines","at most","under \\d+","short"]}],"hint":"Tell the AI which calendar, the exact title, how long each showing is, how to avoid double-booking, and that buyers get no invite.","rubricLabels":["Uses CalendarApp.getCalendarById(\"showings@alderfinch.example\") and createEvent with an end time 30 minutes after the start in column C","Titles each event exactly Showing: <address> - <buyer>, skips the header and rows where E isn't empty, and writes Yes into column E of each row it schedules","Passes no guests or sendInvites option and sends no email, with no triggers, logging or try/catch"]}