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 / Need help with Xpath e...
Power Automate
Unanswered

Need help with Xpath expression

(0) ShareShare
ReportReport
Posted on by 21
Hello all,
 
I am having a bit of a problem trying to make this xpath expression work. Here is my attempt:
 
xpath(
    outputs('Compose_3'),
    concat(
        'count(//root/item[starts-with(., "', 
        first(split(item(), '|')), 
        '") and normalize-space(substring-after(substring-after(., ";"), ";")) != "" and contains(., ";', 
        substring-before(substring-after(item(), "|"), ";"), 
        '")])'
    )
)
 
Here is a sample input for this xpath which is generated from the XML output
 
"Data and Analytics|2024-09;2024-09-30;",
"Data and Analytics|2024-09;2024-09-30;",
 "Enterprise App and Emerging Tech|2024-09;2024-10-01;",
 "Enterprise App and Emerging Tech|2024-09;2024-10-01;",
 "Mobility and Customer Experience|2024-09;2024-10-07;2024-12-31",
  "Mobility and Customer Experience|2024-09;2024-10-07;2024-12-31",
  "Mobility and Customer Experience|2024-10;2024-10-27;2024-11-07",
  "Data and Analytics|2024-10;2024-10-23;2024-12-08",
  "Data and Analytics|2024-10;2024-10-23;2024-12-08",
   "Cloud - Infra - CS and Obser|2024-10;2024-10-24;2024-12-15"
 
A sample of the XML Output:
 
<root><item>Enterprise App and Emerging Tech|2024-07;2024-07-30;</item><item>Enterprise App and Emerging Tech|2024-07;2024-08-08;</item><item>Enterprise App and Emerging Tech|2024-07;2024-07-30;</item><item>Enterprise App and Emerging Tech|2024-07;2024-08-08;</item><item>Enterprise App and Emerging Tech|2024-07;2024-07-30;</item><item>Enterprise App and Emerging Tech|2024-07;2024-08-08;</item><item>Enterprise App and Emerging Tech|2024-07;2024-07-30;</item><item>Enterprise App and Emerging Tech|2024-07;2024-07-30;</item><item>Enterprise App and Emerging Tech|2024-07;2024-08-08;</item><item>Enterprise App and Emerging Tech|2024-07;2024-07-30;</item><item>Enterprise App and Emerging Tech|2024-07;2024-08-08;</item><item>Enterprise App and Emerging Tech|2024-07;2024-07-30;</item><item>Enterprise App and Emerging Tech|2024-07;2024-08-08;</item><item>Enterprise App and Emerging Tech|2024-07;2024-07-30;</item><item>Enterprise App and Emerging Tech|2024-07;2024-07-30;</item><item>Enterprise App and Emerging Tech|2024-07;2024-08-08;</item><item>Enterprise App and Emerging Tech|2024-07;2024-07-30;</item><item>Enterprise App and Emerging Tech|2024-07;2024-08-08;</item><item>Enterprise App and Emerging Tech|2024-07;2024-07-30;</item><item>Enterprise App and Emerging Tech|2024-07;2024-08-08;</item><item>Enterprise App and Emerging Tech|2024-07;2024-08-08;</item><item>Data and Analytics|2024-08;2024-08-28;</item><item>Enterprise App and Emerging Tech|2024-08;2024-09-05;2024-12-12</item><item>Enterprise App and Emerging Tech|2024-08;2024-08-31;2024-09-19</item><item>Cloud - Infra - CS and Obser|2024-09;2024-09-30;2024-10-03</item><item>Data and Analytics|2024-09;2024-09-30;</item><item>Data and Analytics|2024-09;2024-09-30;</item><item>Enterprise App and Emerging Tech|2024-09;2024-10-01;</item><item>Enterprise App and Emerging Tech|2024-09;2024-10-01;</item><item>Mobility and Customer Experience|2024-09;2024-10-07;2024-12-31</item>
 
The objective of the xpath expression is to count all not-null values after the second ";" for each substring before "|" AND each substring between "|" and the first ";" such as "2024-09" from the sample above.
Categories:
I have the same question (0)

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 711

#2
Vish WR Profile Picture

Vish WR 691

#3
Haque Profile Picture

Haque 525

Last 30 days Overall leaderboard