                  ::submitter-email ::submitter-name]
            :opt [::procunciation-hints]))
 
+; this is a bit brittle - based on the structure of the form at some point in time
 (defn row-to-held-person [[timestamp name-for-altar _ pronunciation your-name your-email is-group? name-public]]
   (merge
-    ; Our required fields
-    {::when-submitted (fmt/parse goog-datetime timestamp)
-     ::held-name-altar (trim name-for-altar)
-     ::held-name-public (if (empty? name-public) (first (split name-for-altar #"\s+")) name-public) 
-     ; We could make this more robust - but should be fine for now
-     ::is-group-or-class (and (not (nil? is-group?)) (starts-with? is-group? "YES"))
-     ; ::is-group-or-class is-group?
-     ::submitter-email your-email
-     ::submitter-name your-name}
-    ; And the optional field
-    (when-not (empty? pronunciation) {::procunciation-hints pronunciation}) ))
+    (let [processed-group (and (not (nil? is-group?)) (starts-with? is-group? "YES"))]
+      ; Our required fields
+      {::when-submitted (fmt/parse goog-datetime timestamp)
+       ::held-name-altar (trim name-for-altar)
+       ; We could make this more robust - but should be fine for now
+       ::is-group-or-class processed-group
+       ; The logic is a little complex
+       ; If we lack a public name, we propose one - if it's a group, we just
+       ; use the full text, otherwise we use the first word of the altar name.
+       ; We likely need a dictionary for stop-words like "Ms."
+       ::held-name-public (if (empty? name-public) 
+                            (if processed-group
+                              name-for-altar
+                              (first (split name-for-altar #"\s+")) )
+                            name-public)
+       ; ::is-group-or-class is-group?
+       ::submitter-email (trim (lower-case your-email))
+       ::submitter-name (trim your-name)} )
+      ; And the optional field
+      (when-not (empty? pronunciation) {::procunciation-hints pronunciation}) ))
 
 (defn get-wellbeing-data []
   (->

          (.load js/gapi "client:auth2" #(init-client config-keys)) )
        #_(println keys-resp) )))


(rum/defc hello-world < rum/reactive []
  (let [curr-data (rum/react app-data)]
    [:div
      [:h2 "Wellness Scraper"]

(ns scrape-n-mail.core
    (:require [rum.core :as rum]
              [cljs-http.client :as http]
              [clojure.string :refer [join split starts-with? trim lower-case]]
              [cljs-time.format :as fmt]
              ; dt is for datetime
              [cljs-time.core :as dt]
