Hi everyone.
I'm currently developing a Flow in which the numbers are extracted from SharePoint list (from Get Item).
However, there is a blank (aka Null) in the value section (after Select)
My objective is calculating the sum of numbers (via XPath method/ addition of integers in the body)
WithBlank
NoBlank
Add
Flow
What are the suggested actions and expressions, from WithBlank to NoBlank to Add?
I realise the input collected earlier steps are in array/ string type, so maybe need to change it to integer in WithBlank step
If possible, how about replace the "" (blank)/ null in WithBlank to 0? What is the action/ expression?
Most of the use cases I found online are on Power BI/ Power App, so your assistance is truly appreciated.
Thank you
This should be what you are after. Note I've stated with the list of numbers as strings.
Compose is your array of numbers (strings).
Filter array can be used to remove empty strings as so. Note the expression is just item()
JSON converts the output to XML.
And finally, your xpath to sum up the numbers.
xpath(xml(outputs('JSON')), 'sum(/root/Numbers)')
Result is:
User | Count |
---|---|
22 | |
15 | |
14 | |
10 | |
9 |
User | Count |
---|---|
43 | |
28 | |
25 | |
24 | |
23 |