Initializing help system before first use

Using Inter-scenario Data Access

To access data from an external scenario, use the AppInterface.get_scenario_data() function.
First, define a class decorated using either the ScenarioData() or AppConfig() decorator. The attributes of this class represent the entities you want to read from the external scenario and are declared using xpressinsight.data annotations, as in this example:
import xpressinsight as xi

@xi.ScenarioData()
class MyEntities:
    name: xi.data.Scalar(dtype=xi.string)
    users: xi.data.DataFrame(columns=[
        xi.data.Column('id', dtype=xi.string),
        xi.data.Column('name')
        xi.data.Column('age', dtype=xi.integer)])
For more information about these annotations, see Supported Types.
Note: Most arguments for the xpressinsight.data.* constructors are optional; missing information is filled in from the schema of the external scenario. For example, if you specify the expected type of an entity, the retrieved data is validated to ensure that it is of the specified type. But you can also omit the type, in which case that validation is skipped.
Now call AppInterface.get_scenario_data(), passing two arguments:
  • A string identifying the path or ID of the external scenario (for syntax details, see Repository Paths).
  • The class defining the entities to read.
my_data = self.insight.get_scenario_data('/MyApp/MyScenario',
                                         MyEntities)

The function returns an instance of the class, with the attributes populated with the entity values retrieved from the external scenario.

© 2001-2025 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.