How can I get the values entered for certain fields via Deluge script?

How can I get the values entered for certain fields via Deluge script?

Many a times, when you are developing an application, you may need to get the value(s) entered for the fields in the form. To get the particular value, you can do so in Deluge Script, using the statement:

input.<Field Name>
For ex, if you would like to obtain the value entered for the field with Field Name "Age", you can to write 

input.Age

For Multi-select and Checkbox fields, the above statement will return a collection and you'd need to iterate the collection and get each one of the selected values. You can use for each element task under List manipulation in the Script Builder for the same.

for each <elementname>  in <listname>
{
// write your code here
}
For ex, if you would like to get the values selected for a multi-select field with Field Name "Hobbies", you need to write
for each selectedValue in input.Hobbies
{
alert(
selectedValue);
}