Using Dynamic Variables
<vdl-var>
element which defines a variable's name and its value. Once defined, the variable can be referenced throughout the rest of a View. Variable names should be unique and will be either
globally-scoped or
scenario-scoped, depending on where you define them.
![]() |
Note: A
vdl-var component will feature an orange border when placed on the
artboard in
View Designer. This designates that the item will not be visible in the view when it is published, although the value stored in the var can be displayed if it is attached to a
vdl-text component.
|
Globally scoped dynamic variables
The following view illustrates how to create and use globally-scoped variables.
View Designer
<vdl version="5.6">
<vdl-page>
<vdl-var name="title" value="Portfolio Optimization risky share types"></vdl-var>
<vdl-var name="rows" value="=scenario.entities.ShareIds"></vdl-var>
<vdl-section heading="=vars.title">
<vdl-row>
<vdl-column vdl-repeat="=row in vars.rows" heading="=row.value" size="2">
<div vdl-text="=scenario.entities.Shares_HighRisk(row.value) && scenario.entities.Shares_fraction(row.value).value ? 'Yes' : 'No'"></div>
</vdl-column>
</vdl-row>
</vdl-section>
</vdl-page>
</vdl>
The vdl-text
attribute has been assigned a ternary guard expression to ensure the value is set. The <vdl-var>
elements are positioned outside the <vdl-page>
element to enable global scope.


<vdl version="5.6">
<vdl-page>
<vdl-section>
<vdl-row>
<vdl-column vdl-repeat="=s,i in scenarios">
<vdl-var name="title" value="='Portfolio Optimization scenario: ' + s.props.name" scenario="=i"></vdl-var>
<span vdl-text="=s.vars.title"></span>
</vdl-column>
</vdl-row>
</vdl-section>
</vdl-page>
</vdl>
The scenario index in the preceding example is captured in the
<vdl-repeat>
element as the loop variable
i
, which is then used as the scenario index for the
<vdl-var>
element. For more on
vdl-repeat
, see
Using Loops with Arrays and Sets.
© 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.