Application Framework Reference

Splunk API

set()

The set() method is a generic setter that stores the specified name-value pair, by value, in the context.

The method never assigns a reference value but copies the referenced object.

Synopsis

set( name , value )

Parameters

name

String

Key name to associate with value .

value

Object

Value to be set for key name.

Note: This method overwrites the current value if name already exists.

Example

setBaseSearch: function(baseSearch) {
    var context = this.getContext();
    var search = context.get('search');
		
    search.setBaseSearch(baseSearch);
    context.set('search', search);
}
 

See Also

enforceByValue()
get()
getAll()