1. Home
  2. Docs
  3. User Manual
  4. Changesets
  5. Script Search Variables

Script Search Variables

Within the Iterator and Evaluator Script code it can be beneficial to gain access to parameters on unrelated objects or even to determine if another object exists. The Script Search Variable is a means of performing a search (query) and gaining access to the result set within the associated JavaScript environment for the Iterator or Evaluator Script.

The results of the query are converted into an array object, with each element of the array representing a match. An array object with the length of zero means that no results were found. Each matched object is added into the array as a Plain Old JavaScript Object dictionary.

The query syntax following the normal Changeset Query structure. But the query must contain the additional parameter of GenObject to define the Genesys object type that the search will be based on.

The above example is for an Evaluator Script.

  • The Script Search Variable named host will search for a host object with a name that starts with local
  • The variable host is exposed to the JavaScript environment only and at this stage no changes have been performed to any Changeset Variables
  • In this example the Evaluator Script is a accessing the first element that is matched and is returning the name of the host. Note in this example no error checking has been performed.
  • Evaluator Script will either create or update the Changeset Variable hostName and set its value to the full name of the first instance that is returned by the query.
  • The JavaScript variable host does not persist past the execution of the script

How can we help?