Result.getValue(column)

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. For convenience, this method takes a single search.Column Object.

Note:

This method is overloaded. You can also use Result.getValue(options) to get column values based on the name, join, and summary values for a column.

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

Parameter

Type

Required / Optional

Description

column

search.Column

Required

The search result column from which to return a value.

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 mySearch = search.load({
    id: 'customsearch_my_so_search'
  });

    var resultSet = mySearch.run();
    var firstResult = resultSet.getRange({
      start: 0, 
      end: 1
    })[0];

    // get the value of the second column (zero-based index)
    var value = firstResult.getValue(resultSet.columns[1]); 

    log.debug({
        title: 'Value:',
        details: value
    });
...
//Add additional code 

        

Related Topics

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

General Notices