Random Index from List(Subprogram) Animation nodesV2/Blender 2.79 

Trying to get a Random Index  as a part of a Subprogram.

Attempt 1 -  GetRandomListElement not updating in viewport
GetRandomListElement is not updating in the viewport (eventhough the colors change in viewer on update).Tried using ViewportMaterial &amp; SetVertexColor Nodes.  

  

Attempt 2 -  IterationCount not connecting to RandomNumber Node
While trying to extract a random index from a Color List for animation ,their doesn't seem to be any node which calculates the total iterations in the list. 

On connecting the IterationsCount(Invoke subprogram) to the random number node ,all nodes get red.

How to extract a random index from a list (as a part of a Subprogram)?
I don't think you need to get this kind of convoluted node tree if you just want a random color.

The "Get Random Elements" node has a "Single" mode which will output a single randomly chosen value.

The setup :



Result :



If you just want a random index, you can use the "random" node with a floor math node.