How to refer to a field object by name

How to refer to a field object by name

Hello,

Is there a way to refer to a field object by name? For example, in JavaScript i can refer to a field the following way, but I can't figure out how it's done in Deluge.

for each fld in getFIeldNames()
{
      input[fld] = "My Value"  // i want to set the value of a field here
}

Any help would be apprecaited.