Application Framework Reference

Splunk API

has()

The has() method checks if the context contains the name key.

Synopsis

status = has( name )

Parameters

name

String

Key name to test.

Return Value

Boolean

Requested name key found indication:

true = Key with specified name exists.

false = Key with specified name does not exist.

Example

hasSearch: function() {
    var context = this.getContext();
    if (context.has("search")) { 
        return true;
    else
        return false; 
    }
}