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 / Get a Value after a sp...
Power Automate
Answered

Get a Value after a specific word

(0) ShareShare
ReportReport
Posted on by 132

Hi , i have a pdf with a info with for example "Loading Reference: 12345". I just want the info next to this word "Loading: Reference:". There are random words after this word, so i can't use the action where i can filter between 2 words. any solutions?

 

The "word Loading Reference:" is standard.

I have the same question (0)
  • Verified answer
    Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @Zohaib1999 

    We can achieve using many scripting languages too. But below is PAD way of doing.

    Please use the actions suggested below:

    Deenuji_0-1708613274890.png

     

    Code:

    Pdf.ExtractTextFromPDF.ExtractText PDFFile: $'''C:\\Users\\2440621\\Documents\\Loading.pdf''' DetectLayout: False ExtractedText=> ExtractedPDFText
    Text.Trim Text: ExtractedPDFText TrimOption: Text.TrimOption.Both TrimmedText=> TrimmedText
    Text.SplitText.SplitWithDelimiter Text: TrimmedText CustomDelimiter: $'''(?<=Loading Reference: )''' IsRegEx: True Result=> TextList
    Display.ShowMessageDialog.ShowMessage Title: $'''Alert''' Message: TextList[1] Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed

    Thanks,

    Deenu

  • Zohaib1999 Profile Picture
    132 on at

    It worked :), but are there some limitations? for example the next 5 letters? = 12345

  • Zohaib1999 Profile Picture
    132 on at

    Or maybe till the next blank line. Would be logical in this case

  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @Zohaib1999 

     

    No. there is no limitations on that. It will split any text after "Loading Reference:". Hope this helps!!

     

    Thanks,

    Deenu

    ------------------------------------------------------------------------------------------------------------------------------

    If this helps & solves your problem, please remember to give a thumbs up and accept my solution as it will help others in the future.

  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @Zohaib1999 

    Example1:

    Deenuji_0-1708614187363.png

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You can use Parse text with regular expressions enabled and use the following as the pattern:

    • (?<=Loading:\sReference\s)\d+  for any number of digits after the phrase
    • (?<=Loading:\sReference\s)\d{5} for 5 digits after the phrase
    • (?<=Loading:\sReference\s)[^\s]+ for any number of non-whitespace characters after the phrase

    Plenty of other possible combinations, too.

     

    The action should look like this:

    Agnius_0-1708667622264.png

     

    You put the regular expression into the "Text to find" field, and enable the "Is regular expression" toggle. The output will then be stored in the variable called %Match%.

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 605

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard