Hello,
A way to achieve that is to use a temp collection "CountCollection" :

ClearCollect(CountCollection;{Count:true;Value: 0});;
ForAll(
test_col;
If(
Last(CountCollection).Count;
If(
ThisRecord.Value = "C";
Collect(CountCollection;{Count: false;Value: Last(CountCollection).Value + 1});
Collect(CountCollection;{Count: true;Value: Last(CountCollection).Value + 1})
)
)
)
//then use Last(CountCollection).Value to get the index
We will put in it a column "Count" to true at the start, and a field "Value" to count the iteration.
Inside the ForAll, If the record is not the element we need to find, we add an entry in our "CountCollection" with the column "count" to true and "Value" to last Value + 1.
When we find the element, we collect a last entry in "CountCollection" with "count".
With the "If condition" at the start of the ForAll, Once the last entry of the "CountCollection" count column is set to false they will be no more entry.
At the end to get the index you can take the value of the last element of the "CountCollection".7
(Sorry I'm french and maybe my english is not that good, and take care to replace ";" by "," in the code)