PowerApps does not have a loop construct so it's not possible to iterate through a set of values and then perform some action within the loop. However, PowerApps does have a ForAll function which evaluates a formula for all records of a table. ForAll can be nested, so we can use a nested pattern to generate collections with quite a large number of rows. For example, a collection with 10 rows allows us to generate a new collection with 100 rows.
The following code snippet allows us to build a collection with a specified number of rows. ======================= //define a base collection from which you will generate your target collection. ClearCollect(colBase, [1,2,3,4,5,6,7,8,9,10]);
//specify target rowcount Set(vMaxRows, 57);
//setup collections to be used as inner and outer counters ClearCollect(colOuter, colBase); ClearCollect(colInner, colBase); Set(vOuterMax, CountRows(colOuter));