Result.getValue(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Used on formula and non-formula (standard) fields. Returns the value of a specified search result column. Takes in arguments for name, join, and summary.

Note:

This method is overloaded. You can also use Result.getValue(column) to get column values. This method takes in a single search.Column.

Important:

If you have multiple search return columns and you apply grouping, all columns must include a summary property.

Returns

The return type depends on the type of search result column that was specified:

  • boolean if the column is a box field

  • number if the column is a record, list, decimal number, or image field, with the following considerations:

    For image fields, the returned number represents the ID of the image file.

  • string for all other column types, with the following considerations:

    • For multiselect fields, the returned string represents a comma-separated list of IDs. Each ID represents a selectable option in the field.

    • For date/time fields, the returned string represents the formatted string value of the date. You can use methods in the N/format module to work with this string (for example, converting it to a Date object). For more information, see N/format Module.

Supported Script Types

Client and server scripts

For more information, see SuiteScript 2.x Script Types.

Governance

None

Module

N/search Module

Since

2015.2

Parameters
Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

options.name

string

Required

The search return column name.

options.join

string

Optional

The join id for this search return column.

Join IDs are listed in the Records Browser. For more information, see Working with the SuiteScript Records Browser.

options.summary

string

Optional

The summary type for this column. See search.Summary.

options.func

string

Optional

Special function for the search column. See Column.function.

Syntax
Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/search Module Script Samples.

          //Add additional code
...
var searchResults = mySearch.run().getRange({
    start: 0,
    end: 100
});
for (var i = 0; i < searchResults.length; i++) {
  var amount = searchResults[i].getValue({
    name: 'amount'
  });
  var entity = searchResults[i].getValue({
    name: 'name',
    join: 'location'
  });
...
//Add additional code 

        

Related Topics

search.Result
N/search Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices