Microsoft PowerApps does not currently support indexing in collections. There are some differences between true arrays (e.g. JavaScript) and PowerApps collections. Microsoft has commented that indexing will not be supported in collections (at least in the near future). With that, the closest data structure in to arrays in PowerApps is tables. However, I prefer to work will collections and with that I wanted to come up with a solution to index them.

The formula itself is simple; loop through your original collection (e.g. SharePoint list items, drop-down options, etc.) and then copy it to a new collection. While collecting each item, count the rows of the collection as it grows. That’s it, so what does that look like?

Here’s my original collection of statuses:

Copy to Clipboard

 

Here’s my indexed collection after the ForAll() loop above:

Copy to Clipboard

 

To see a practical application of the technique check out my YouTube How To on indexing collections here: