NSOA.form.getValue(field)

Use this function to get the value of the field on the form. Keep in mind, any pick lists (for example Customer:Project, Employee, Expense item) will return an internal_id and not a text value. In this release, only fields directly related to the form are available (for example no related table lookups are available now). See also NSOA.form.getAllValues() and NSOA.form.get_value(field).

Parameters

field {string} [required] — The name of the field on the form.

Note:

This is not the label the user sees displayed next to the field on the form. Use the Form Schema to find the correct field name value.

Returns

The value in the specified field. Use the Form Schema to find the data type of the returned value.

Note:

Some fields return an object. See Object Fields for more details.

Units Limit

1 unit

For more information, see Scripting Governance.

Since

August 17, 2013

Example

  • This example creates a local variable called receiptDate and sets its value to the content of the date field on the form the script is attached to.

                        var receiptDate = NSOA.form.getValue('date'); 
    
                  
  • This sample gets a value from a field that returns an object. See Object Fields for more details.

                    // First get the object variable for the field and then get the cost_0 value for the first row
    var loaded_cost_obj = NSOA.form.getValue("loaded_cost");
    var value = loaded_cost_obj[0].cost_0;
    
    //  You can combine these two steps into one line
    var value = NSOA.form.getValue("loaded_cost")[0].cost_0; 
    
                  

See Code Samples for more examples.