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 / using the xpath math f...
Power Automate
Unanswered

using the xpath math functions

(1) ShareShare
ReportReport
Posted on by 2 Microsoft Employee

I'm trying explore using the xpath function to get access to proper math

 

In particular, I'm trying to access functions and operators in the xpath Math namespace

 

So in a compose action, I've entered the below expression:

 

 

xpath(xml('<root><numbers>16</numbers></root>'),'math:sqrt(/root/numbers)')

 

 

and attempted to evaluate it in an empty flow.

 

It throws an error, namely "The XPath expression evaluates to a result of type 'Any' that is not supported. The expression must evaluate to a number, a string, a boolean, or a node set."

 

However, this is a different error than when I use improper syntax in the xpath function, which leads me to believe it is being evaluated, but the result is not parseable by power automate.

 

I've attempted to wrap the math:sqrt() in the string() expression to force the result to be returned as a string but get an error indicating my xpath expression is not formatted correctly.

 

How do I properly write this xpath expression to actually retrieve the math:sqrt result?

 

This particular result is not super valuable, but I ultimately want to be able to use more of the math:pow function to be able to return the result of fractional exponentiation, since there is no way to arrive at that or an approximation natively in power automate.

 

Note: I also attempted the below expression with the same outcome, where the result was of type "Any":

 

xpath(xml('<root><numbers>16</numbers></root>'),'math:sqrt(16)')

 

Categories:
I have the same question (0)
  • grantjenkins Profile Picture
    11,063 Moderator on at

    My understanding is that Power Automate only supports XPath 1.0. The XPath sqrt function was only introduced in XPath 3.0 so won't be supported in Power Automate at this time. I've discussed with some Microsoft engineers around XPath support, and they don't seem to have an indication of when the supported version of XPath will increase - fingers crossed it will happen.

     

    I'll have a look as to how else you can get the sqrt and let you know. It's a shame that a lot of core functions you would expect natively within Power Automate just aren't there yet.

  • grantjenkins Profile Picture
    11,063 Moderator on at

    @usernamedgreg After a bit of research, all I've found around options to use functions like sqrt within Power Automate is the following.

    1. Office Scripts - can create a script that has a single number parameter that returns the sqrt
    2. SharePoint List - have a list that contains calculated columns set with SQRT and POWER functions
    3. Excel - would need to explore this option further, but possible to have an Excel functions template were you could save a number to it (in a particular cell) and have the sqrt function pointing to that cell
    4. Power Apps - depends on if you're using both Power Apps and Power Automate as part of your solution

     

    Definitely not ideal - I'm anxiously waiting for these sorts of functions to be available natively within Power Automate and/or update to XPath version supported.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 922

#2
Valantis Profile Picture

Valantis 837

#3
Haque Profile Picture

Haque 534

Last 30 days Overall leaderboard