Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Increment variable giving wrong result

(0) ShareShare
ReportReport
Posted on by
 

I got dynamic custom HTML table generated through flow getting data from SharePoint list based on filter query as shown in below fig. Here I am able to get filter data in dynamic HTML table but I could not got the way to get Total sum value from Budget. It is giving wrong result. 

 

I tried increment variable but its not giving exact results

1st iteration , i got correct result but in 2nd iteration it is adding result of 1st iteration as well. Any idea how to solve this? IS this possible????

flow-r (2).png3.JPG

  • Verified answer
    sgr Profile Picture
    on at
    Re: Increment variable giving wrong result

    @rsaikrishna  Thank's for your tips. It worked, I just need to set another variable sumofbudget to 0  after Style block. (i.e before apply to each for increment variable) so that in next iteration it do not take sum of previous but takes 0. CASE SOLVEDsum-solved.JPG

  • sgr Profile Picture
    on at
    Re: Increment variable giving wrong result

    @rsaikrishna after increment var.. it just send email to respective one..

    increment -aftr.JPG

  • Verified answer
    rsaikrishna Profile Picture
    3,703 on at
    Re: Increment variable giving wrong result

    @sgr 

     

    Do you have any more flow actions after "Increment Variable" action?

     

    Regards

    Krishna Rachakonda

  • sgr Profile Picture
    on at
    Re: Increment variable giving wrong result

    @rsaikrishna  here is the full one..

    New Project (15).jpg

  • rsaikrishna Profile Picture
    3,703 on at
    Re: Increment variable giving wrong result

    @sgr 

     

    Something is missing from your screen shot.

     

    Can you please share your entire Apply to each condition? I do not see where you are adding the values?

     

    Regards

    Krishna Rachakonda

  • sgr Profile Picture
    on at
    Re: Increment variable giving wrong result

    @rsaikrishna 

     

    You mean this? i got same result as before

    rs-sugg.JPG

  • MJain Profile Picture
    2,450 on at
    Re: Increment variable giving wrong result

    Hi @sgr,

     

    Please use the following url to compute the sum :

     

    https://powerusers.microsoft.com/t5/Building-Flows/Calculate-sum-of-multiple-numbers/td-p/334399

     

    Thanks

  • rsaikrishna Profile Picture
    3,703 on at
    Re: Increment variable giving wrong result

    @sgr 

     

    In the Apply to each, before setting a variable, place a Compose action.

    In the compose action, place the expression from the variable.

    Then, set the variable value to the output of Compose.

    5.JPG

     

    NOTE: variables can not be used to set values to itself in a loop.

     

    Please give a try and let me know if this works for you.

     

    Regards

    Krishna Rachakonda

    If my reply helped you solving the issue, please mark the reply as Accepted Solution.

  • sgr Profile Picture
    on at
    Re: Increment variable giving wrong result

    @rsaikrishna  as show in figure, it produced two output

    in 1st output total budget sum is correct, in 2nd output it is summing total budget from previous output as well.

     

    the html output is correct, i have no issues with that; it shows budget and project correctly.

     

     

  • sgr Profile Picture
    on at
    Re: Increment variable giving wrong result

    @ManishJain  That what i wanted; and filtered the data first and convert to HTML.
    The HTML output is fine; all the budget amount in row/column are correct result.

    Only problem is sum. 

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow