Skip to main content

open(input?, config?)

Open Spotlight. If an input is supplied, it will prefill Spotlight's search input with that value. Optionally, open Spotlight with a tab or filter preselected.

Example

Open Spotlight

window.CommandBar.open();

Open Spotlight with pre-fill

window.CommandBar.open("say hi");

Open Spotlight with preselected Category

window.CommandBar.open("", { categoryFilter: "navigation" });

Open Spotlight with preselected Category by it's id

window.CommandBar.open("", { categoryFilter: 1 });

Method parameters

input

string

Optional input to prefill the Spotlight's search field.

config

object

Configure how Spotlight should open.

PropertyTypeDescription
categoryFilterstring | numberOpen Spotlight with a filter preselected. If the filter exists as a tab, the tab will be selected; if not, a tag that says the filter is applied will show. Accepts either a category name or a record set name as a string or a category ID as an integer.