Power Automate (WDL) function
xpath — Power Automate (WDL) function reference
Query an XML document.
Syntax
wdl
xpath(xml, expression)
Examples
wdl
xpath(xml(body('HTTP')), '//title/text()')→ Matching nodes
wdl
xpath(xml(body('HTTP')), 'string(//Invoice/Total/text())')→ A plain string value, e.g. "1250.00"
wdl
xpath(xml(triggerBody()?['content']), '//Item/@sku')
→ An array of matching sku attribute nodes
Common mistakes & gotchas
- xpath() returns an array of XML nodes by default, even for a single match — wrap the XPath expression itself in string(...) when you need a plain string result instead of a node array.
- The input must already be XML, typically produced by xml() — passing raw text without parsing it first throws.
Related Workflow Definition Language functions
From Objects & JSON