Accessing Set Entities
 
 Set entities are treated as one-dimensional arrays, each element being an object with a value and a label property.  
 
You can access the elements of a set with the square bracket [ ] notation. Set entities are simple arrays and it is very common to iterate over them.
View Designer
 
  
 
 Code editor 
 
 
<vdl version="4.7">
    <vdl-page>
        <vdl-section heading="Accessing set entities">
            <vdl-row>
                <vdl-column vdl-repeat="=item in scenario.entities.RISK">
                  <span vdl-text="=item.value"></span>
                </vdl-column>
            </vdl-row>
        </vdl-section>
    </vdl-page>
</vdl>
 
 renders as: 
  
  
  
  
 
  For more on loops and the 
 <vdl-repeat> element, see 
 Using Loops with Arrays and Sets. 
 
  Rendered View of a Set Entity
If you wish to extract individual elements from a set entity, you need to protect the statement with a guard:
 
  
 <span vdl-text="=scenario.entities.RISK.length && scenario.entities.RISK[0].value ? scenario.entities.RISK[0].value : '' "> </span>
By default, Set data is sorted based on the data type. You can provide custom sorting and/or change the sorting direction to descending, for more, see VDL Set Sorting.
