Why getRange('A2:A') returns blank rows, and why that breaks setChoiceValues
When you call getRange('A2:A').getValues() on a sheet, Apps Script returns a two-dimensional array that extends to the last row of the sheet's grid — not the last row with data. A sheet with 10 project names in rows 2–11 and a grid ceiling at row 1000 will hand you 999 rows, most of them [''].
setChoiceValues throws the error 'Choice values cannot be empty strings' the moment any element in the array is a blank string. The fix is a filter step before you pass the array in. The script above maps each row to a trimmed string first, then filters out anything that is empty or the string 'undefined' (which String() produces when a cell contains the literal undefined value from a formula gone wrong).
The guard after the filter is equally important: if the sheet column is empty for any reason — wrong sheet tab, stale SHEET_ID, an accidental clear — the function throws early rather than silently replacing your dropdown with nothing. I burned twenty minutes the first time this happened because the form looked fine in the editor but all choices had vanished for live respondents.