Is it possible to sum an array (from a specific value)? Right now I am using a get items action for SP, then I put the array returned into a variable that I then use a compse action to find the length (so I can count the items returned). Is it possible to sum values from a field in that get items?
I have tried creating a variable outside of a foreach, then adding the value from the array to that variable within the foreach and setting the variable. It certainly increments in value but it is not sequential (i.e. the first 2-3 runs add correctly, but then it becomes sporadic and does not return the correct result).
Can you capture a screenshots of the detailed configuration about this flow? Including the trigger and the related fields.
The trigger is a recurrence - I am getting items from a SP List. I want to iterate through each item (using a for each) and sumthe values of the column "Unit_x0020_Cost". I set a variable as a float (because this column contains non integer values) and then add the column "Unit_x0020_Cost" to that variable within a foreach from the get item array. I then set the variable to the output of that function. I get odd returns (for the record each of the values in this column have been filtered to a single value to make verifying the math easier - each item has a value of 3.5)
First return is 3.5
Second return is 7 (which is correct)
Third return is 10.5 (also correct)
Fourth return goes back to 3.5 (not correct)
Then it's all over the place from there.
Speakers, submit your sessions now! Call for speakers ends Feb. 10!
We've updated and improved the layout and uploading format of the Power Automate Cookbook!
Fill out a quick form to claim your user group badge now!
We've given our badges an overhaul and also added some brand new ones!
Learn how to build the business apps that you need.
Find out where you can attend!
Watch & learn from the Power Automate Community Video Gallery!