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 / Extracting Text from P...
Power Automate
Unanswered

Extracting Text from PDF and finding the Keywords

(1) ShareShare
ReportReport
Posted on by 9
Hi, 
 
I am extracting text from pdf and searching for 50 keywords which are Transaction 1, Transaction 2 up to Transaction 50. After extraction, I am passing each keyword(Transaction1) and searching for keyword to extract the pdf pages and creating sub pdf files depending on the keyword. I ran in to an issue where, Transaction 1 is being detected from Transaction 11 and Transaction 2 is being detected when I pass Transaction 21, Transaction 22 etc.
 
As these items are dynamic, I cannot use Parse Text. I tried using text boundaries - "\\b" & %CurrentItem% & "\\b" on a variable and passing this value to Parse Text action to get the result but the variable is just appending \\b to the text.
 
Please let me know how to achieve this.
 
Thanks in advance!
PAD Error.png
I have the same question (0)
  • stampcoin Profile Picture
    5,146 Super User 2026 Season 1 on at
     
    You can try this pattern ( you may want to  change it a little as your need)
     
        Set variable RegexPattern to "\bTransaction\s+" & 'CurrentItem'& "\b"
    or
        Set variable RegexPattern to "Transaction\s+" & 'CurrentItem' & "(?!\d)"
     
    good luck.
  • SN-09051636-0 Profile Picture
    9 on at
     
    Thank you for responding. Here my current item is Transaction 1, Transaction 2 etc. I have tried your solution but it is appending '& "\b  to my variable and after parsing using Parse text, its not finding the match. Here is the screenshot for the variable value.
     
                    
     
    I have a list of Transactions and for each transaction, I am extracting the pdf file pages. 
     
    Thanks!
  • stampcoin Profile Picture
    5,146 Super User 2026 Season 1 on at
    I assume that currentItem is integer/Number
    if currentItem =1 , target = \bTransaction\s+1(?!\d)
    • \b is a word boundary to ensure "Transaction" isn’t part of a larger word.
    • \s+ matches the space (or any whitespace) after "Transaction" (allows for one or more spaces if formatting is inconsistent).
    • 1 (N)is the current number (e.g. 1, 2, 11, etc., inserted dynamically).
    • (?!\d) is a negative lookahead that ensures the number N is not followed by another digit. This prevents partial matches like "1" within "11".
    could you please try: Set variable RegexPattern = "\\bTransaction\\s+" & %CurrentItem% & "(?!\\d)"

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
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard