Im trying to iterate through a SharePoint list and adding one field of each item, getting the total value of the field in all items.Example:Get SharePoint List Items• Item 1: Name: Markus , Age: 20• Item 2: Name: Ana, Age: 30ForEach Item:• Compose Age Item 1 + Age Item 2Total Age of all items = 50….How can we achieve this with flow ?Markus
If item1 and item2 are two items from the same SharePoint list, then I am afraid add the corresonding age together is not an easy task.
The thoughts here is first find the age of Markus (One Apply to Each), then iterate through the SharePoint lists(another apply to each) again to get Age of Ana, and add them together.
The limitaion here is nested Apply to each is not supported, at least currently.
Workarounds here is to use formula to find the proper item.
Writing in this way would be able to find the other array item, in Microsoft Flow, WDL language uses number to query the array item, start from 0.
This would require the item sequence being noticed when configuring Flow.
Assuming the corresponding item from SharePoint List->Get items Action is 3, and 5, then the formula which would add them together should be:
For two fields defined in the same SharePoint list, we could add a calculated column directly in SharePoint list, or using one Apply to each to make it work.
Check out the on demand sessions that are available now!
Check out the community blog page where you can find valuable learning material from community and product team members!