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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Increment Var inside A...
Power Automate
Answered

Increment Var inside Apply to each issue

(0) ShareShare
ReportReport
Posted on by 3,187

I have a flow that is kicked off from a power app and it loops through a ledger list and needs to sum the totals of 2 columns into one value. My issue is that no matter how I try to do this, the total at the end comes up short of the actual total or the flow fails due to finding a blank value when expecting a float, int, etc. 

 

Here is the code for my increment variable inside the apply to each:

add(item()?['TripMileageCost'],item()?['TripExtraCosts']) -> (fails due to null value found instead of float, int. etc)
 
I previously had 2 increment var actions inside the apply to each one for each of the above item() calls and that is the one that shows the incorrect total. The total should come to 190 but only shows 160.
 
Not sure why its missing values from the list as they all show up in the formatted HTML table I send at the end of the flow. When i total those values, it comes out to 190 as expected. 
 
TIA! Mike
Categories:
I have the same question (0)
  • mmollet Profile Picture
    3,187 on at

    Trying to debug this issue and when I use just item()?['TripExtraCosts'] it returns the correct total for that column. When I use just item()?['TripMileageCost;] it returns 6 which is not correct. This is the number of iterations rather than the total of the column over the 6 iterations. Not sure why this would happen with one column and not the other. 

     

    Both columns are number types with $ selected as well as set to 2 decimal places. 

    There are no blank values in either of these columns as I am using a test data set for development. 

     

    Any help is appreciated as this is the last piece of the app and they I can start having users test it. 

     

    Thank you!

  • Verified answer
    mmollet Profile Picture
    3,187 on at

    After thinking about this for a while I decided to look into the output of the get items call earlier in the flow. When i searched for the column title nothing was there. in order to find the column title it was using i just searched the value i was expecting from one of those line items. Come to find out it was using a different column name than it has currently. Once i swapped the code over to the new name it worked right away. Never had this issue and seems like a ridiculous thing to happen. When a user changes a column name it should actually change the column name rather than give it a 'nickname' that is only used for display purposes. Even going into edit the column properties does not show the 'true' column name. Is there a way to see this or change this that i am missing?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 304

#2
David_MA Profile Picture

David_MA 245 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 243 Most Valuable Professional

Last 30 days Overall leaderboard