Initializing help system before first use

# Accessing Data

When a scenario observer notify callback is invoked the scenario objects passed in are preloaded with the latest data for the observed entities
You can access the data for these entities as follows:

    // Accessing entity data
    view.withFirstScenario()
       .withEntities('SCALAR1', 'parameters', 'SET1')
       .notify(function(scenario) {
           var scalar1 = scenario.getScalar('SCALAR1');
           var parameter1 = scenario.getParameter('PARAMETER1');
           // set1 is a JavaScript array
           var set1 = scenario.getSet('SET1');
       })
       .start();

Sets are returned as JavaScript arrays with the values in the array corresponding to the set elements. By default the server will order set values alphanumerically.

    scenario.getSet('myset').forEach(function(v) { console.log(v); });

Array values are accessed by specifying the array entity name and one or more tuples of index values.

    // Accessing array entity data
    view.withFirstScenario()
       .withEntities('Population', 'Countries')
       .notify(function(scenario) {
           var countries = scenario.getSet('Countries');
           var population = scenario.getArray('Population');
           countries.forEach(function(country) {
               var country = population.getValue([country]);
               console.log(country);
           });
       })
       .start();

Parent Topic The ScenarioObserver

© 2001-2026 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.