Dynamically Adding Items to a Picklist

Dynamically Adding Items to a Picklist

Hello,

I pasted the following code into free flow scripting, as directed on the Zoho help page with the same title as my post:


Country
(
type = picklist
values = Country.Country_Name
sortorder = ascending
on user input
{
if (count(State[Country_Name == input.Country]) == 0)
{
clear State;
}
else
{
for each state_list in State [Country_Name == input.Country]
{
State:ui.add(state_list.State_Name);
}
}
}
)




















and received the following message when I tried to save the script:

Encountered "=" at line 4, column 19. Was expecting one of: "," ... ")" ... "*" ... "/" ... "%" ... "||" ... "&&" ... "==" ... "!=" ... ">" ... ">=" ... "<" ... "<=" ... ... "not" ... "in" ... ... "is" ... "+" ... "-" ... "." ...


Any suggestions? I tried to follow the directions using Script Builder also, but couldn't make any headway. I'm new to Zoho, new to databases, and new to programming, so any help would be appreciated.

Todd