web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Loop through SharePoin...
Power Apps
Unanswered

Loop through SharePoint/Lists columns while adding together all the numbers in the 'Value'

(0) ShareShare
ReportReport
Posted on by 18

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

Categories:
I have the same question (0)
  • Scott_Parker Profile Picture
    1,090 on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard