cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sgr
Helper I
Helper I

Increment variable giving wrong result

 

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

2 ACCEPTED SOLUTIONS

Accepted Solutions

@sgr 

 

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

 

Regards

Krishna Rachakonda

View solution in original post

@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

View solution in original post

12 REPLIES 12
ManishJain
Solution Sage
Solution Sage

Hi @sgr ,

 

Are you filtering the data by code first and then summing the data .

 

Thanks

@sgr 

 

Please check the flow execution result and check how many items the Get Items action returned in every iteration. If the Get Items return more than you expected, then something wrong in the Filter Query in Get Items action. Once you correct it, everything will be fine.

 1.JPG

 

Please let us know if you have any more questions.

 

Regards

Krishna Rachakonda

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

 

@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. 

 

@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 

 

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.

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 

 

You mean this? i got same result as before

rs-sugg.JPG

@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

@rsaikrishna  here is the full one..

New Project (15).jpg

@sgr 

 

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

 

Regards

Krishna Rachakonda

View solution in original post

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

increment -aftr.JPG

@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

View solution in original post

Helpful resources

Announcements
Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Users online (1,297)