
Announcements
Sounds simple enough, yet after hours of googling I couldn't find a way to do something as basic ForEach'ing the list/table contents to do the other operations. I'm trying to do something like
ForAll('TESTLIST', ForAll(ThisRecord,
I've been trying to iterate through ThisRecord for hours to no avail, please help. I have to find a way to do such a loop else I'll have to do some dumb stuff, like
Value(Left(ThisItem.'Column 1'.Value, 2)) + Value(Left(ThisItem.'Column 2'.Value, 2)) + Value(Left(ThisItem.'Column 3'.Value, 2))
which works but I'd have to do it for 60+ different rows, so that's not a good option in the slightest
Right, you won't be able to find anything; unfortunately, this isn't how Power Apps works.
There is no such thing as iterating through a loop. ForAll() is analogous to a map() function in other languages. ForAll just does something for each record within the table. Also can't write to variables within a ForAll() because ForAll doesn't iterate through the table in a deterministic order.
You cannot iterate "across" a record or even refer to field names in a dynamic way. All field names must be explicitly specified as a string primitive (when using AddColumns, DropColumns, etc.) or as a property (.Column1, etc.).
If you want to sum up rows, use aggregation functions: Average, Max, Min, StdevP, Sum, and VarP functions in Power Apps - Power Platform | Microsoft Learn
However, it appears that you are trying to sum across the columns. If so, then there is likely something wrong with your table schema. Possibly you're trying to aggregate a table which has been pivoted and you should unpivot it. If you're confident that your columns are correct, then there really isn't another option aside from writing out every single column name in your formula.