mapContext.value

Property Description

The value to be processed during the map stage.

  • If the input is an array, mapContext.value is the element's value.

  • If the input is an object, mapContext.value is the object's value.

  • If the input type is a result set, the mapContext.value is a search.Result object converted to a JSON string by using JSON.stringify().

Note:

Each value cannot exceed 1 megabyte.

Type

string

Since

2015.2

Syntax

The following code snippet shows the syntax for this member. It's not a functional example. For a complete script example, see SuiteScript 2.x Map/Reduce Script Code Samples.

            // Add additional code.
...

// Assume that the search result is a list of phone call records. This snippet parses the results
// and uses the values of the title and the message fields from each record.

var searchResult = JSON.parse(context.value);
          
var title = searchResult.values.title;
var message = searchResult.values.message;

...
// Add additional code. 

          

Related Topics

General Notices