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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

XPath with word

(1) ShareShare
ReportReport
Posted on by 55

Hi

I'm trying to extract the value txtApprouved from a Word document using Power Automate, but I'm encountering issues with my XPath expression.

Here’s the structure of the document I’m working with:

  • Object: {1}
  • Document: {37}
  • Body: {3}
    • Paragraphs (p): [9]
      • 0: {6}
      • 1: {7}
      • 2: {8}
        • pPr: {6}
        • Runs (r): [4]
          • Structured Document Tag (sdt): {3}
            • sdtPr: {7}
              • rPr: {2}
                • Alias:
                  • _w:val: txtApprouvedBy
                  • __prefix: w
              • Tag: {2}
              • Placeholder: {2}
              • docPart: {2}
                • _w:val: DefaultPlaceholder_-1854013440
                • __prefix: w
            • sdtContent: {2}
              • Runs (r): {4}
                • rPr: {2}
                • Text (t): {2}
                  • __prefix: w
                  • __text: administration

My current XPath expression is as follows:

xpath(xml(outputs('Xml')), 'string(//*[local-name()="sdt"][.//*[local-name()="alias"][@w:val="txtApprouvedBy"]]//*[local-name()="sdtContent"]//*[local-name()="t"]/text())')
However, I'm getting an error indicating that the XPath can't extract the desired text.

Can someone help me troubleshoot this XPath expression or suggest an alternative method to extract the txtApprouved value?

Thank you!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard