Skip to content

pkarda/logic-apps-xpath-expressions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 

Repository files navigation

Logic Apps XPath Expressions

This cheat-sheet contains various Xpath expressions used in Azure Logic Apps.

String operations

Sample XML

<Order>
  <Product>
    <Description>Espresso</Description>
    <Price>1.50</Price>
    <Size>S</Size>
  </Product>
    <Product>
    <Description>Double Espresso</Description>
    <Price>3.00</Price>
    <Size>M</Size>
  </Product>
  <Product>
    <Description>Latte Espresso</Description>
    <Price>2.50</Price>
    <Size>M</Size>
  </Product>
  <Product>
    <Description>Water</Description>
    <Price>0.50</Price>
    <Size></Size>
  </Product> 
 </Order>

XPath to get the Price of the Latte Expresso product

xpath(variables('Order'), 'string(/*[local-name()="Order"]/*[local-name()="Product"][*[local-name()="Description" and text()="Latte Espresso"]]/*[local-name()="Price"])')

XPath to get a count of all the products

xpath(variables('Order'), 'count(/*[local-name()="Order"]/*[local-name()="Product"])')

XPath to get a count of the products with Size M

xpath(variables('Order'), 'count(/*[local-name()="Order"]/*[local-name()="Product"][*[local-name()="Size" text()="M"])')

XPath to get a count of the products with Size not empty

xpath(variables('Order'), 'count(/*[local-name()="Order"]/*[local-name()="Product"][*[local-name()="Size"]/text())')

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors