Update list in form from script

Update list in form from script

I am having a problem updating a list field in a form from a script.

This is not accepted by script builder

myform.mylistfield.add("item")

This fails on execution

local_list = List:String()
local_list.addAll(myform.mylistfield)
local_list.add("item")
myform.mylistfield = local_list




Error is:


Error occured while executing the script.
Unable to update data on the form variable null
Error occured

Thanks for any help.

Julian