| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
The intrinsic function Fn::Select returns a single object from a list of objects by
index.
Important
Fn::Select does not check for null values or if the index is out of bounds of the array. Both conditions will result in a stack error, so you should be certain that the index you choose is valid, and that the list contains non-null values.
{ "Fn::Select" : [ index, listOfObjects ] }
The index of the object to retrieve. This must be a value from zero to N-1, where N represents the number of elements in the array.
The list of objects to select from. This list must not be null, nor can it have null entries.
The selected object.
{ "Fn::Select" : [ "1", [ "apples", "grapes", "oranges", "mangoes" ] ] }This example returns: "grapes".