web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / XML xpath expression t...
Power Automate
Unanswered

XML xpath expression to get sum

(0) ShareShare
ReportReport
Posted on by 37

Hi Team,

 

I have been trying to execute an XPath expression in order to get the sum of a few nodes but it returns an "invalid XPath expression"

 

Below is the sample xml 

"<Xavor>

<Dev>
<NewNode1>1234</NewNode1>
<Emp>1</Emp>
<Floor>1</Floor>
<Salary>1200.4</Salary>
</Dev>
<Dev>
<NewNode1>1234</NewNode1>
<Emp>123</Emp>
<Salary>3</Salary>
</Dev>
<Dev>
<NewNode1>1234</NewNode1>
<Emp>3</Emp>
<Salary>1000</Salary>
<Floor>1</Floor>
</Dev>
<Dev>
<NewNode1>1234</NewNode1>
<Emp>4</Emp>
<Salary>3</Salary>
</Dev>
</Xavor>"
 
Xpath query expression I have used:- SUM(Xavor/Dev/Salary)
 
Please help to correct any syntax I have missed.
 
Thanks 
Aditya
I have the same question (0)
  • yoko2020 Profile Picture
    495 on at

    Try this

     

    sum(/*/Dev/Salary[string(number(.)) != 'NaN'])

  • Aditya_93 Profile Picture
    37 on at

    I have tried the above path expression, but it's still giving me error as "invalid XPath expression"

    Can you please help me?

  • fraenK Profile Picture
    2,125 on at

    Please post the full error message!

     

    It seems like PAD only supports retrieving nodes and its attribute values, not calculated values.

    So you need to get all desired node values first as a list and then process this list for calculation.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard