I'm an experienced old-school coder (GW-BASIC, anyone?), but just now trying to learn how to use Google Apps Scripts, and I'm completely lost on how to continue my project once the basic Form is created and I open the script editor. The tutorials get a little too advanced too quickly and don't include the basics of what I need.
If someone can assist with a simple "hello world"-type script bound to a Google Form so I can see the syntax to do what I want then it will get me on the right path to work on my project...
So, here's my contrived script: a 3 Section Google Form that asks a person's birth date on the first Section, gives the person's western Zodiac sign on the second Section, then gives the person's Chinese Zodiac sign on the third page. I expect it to look something like this.
Section 1 has a Date question "What is your Birth Date?" I don't know the syntax for saving variables (my first issue), so let's just say to save it as @bd.
The script should perform the following two calculations (LOOKUP formulas following syntax verified by Google Sheets):
LET wz=LOOKUP(VALUE(LEFT(@bd,FIND("/",@bd)-1)*100+LEFT(RIGHT(@bd,LEN(@bd)-FIND("/",@bd)),LEN(@bd)-FIND("/",@bd)-5)),{120;219;321;420;521;621;723;823;923;1023;1122;1222},{"AQUARIUS";"PISCES";"ARIES";"TAURUS";"GEMINI";"CANCER";"LEO";"VIRGO";"LIBRA";"SCORPIO";"SAGITTARIUS";"CAPRICORN"})
LET cz=LOOKUP(MOD(VALUE(RIGHT(@bd,4)),12),{0;1;2;3;4;5;6;7;8;9;10;11;12},{"Monkey","Rooster","Dog","Pig","Rat","Ox","Tiger","Rabbit","Dragon","Snake","Horse","Goat"})
Section 2 has a Title/Description box that says "Your Zodiac sign is @wz"
Section 3 has a Title/Description box that says "Your Chinese Zodiac sign is @cz"
That's it. If someone can produce this simple script then I'll be able to execute my much grander application of Google Scripts.