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 / Find text and get valu...
Power Automate
Unanswered

Find text and get value after that text - Only works for the first value

(0) ShareShare
ReportReport
Posted on by 60

Hi all,

 

I have a PDF document with several rows that gives a projectnumber. So I parse that text: Find project number and get subtext of 8 characters.

 

This works fine, but just for the first found projectnumber.

 

Celia_0-1678271884749.png

So, I thought I just switch off the 'Only first one' and then it would loop untill it has all projectnumbers. But when I switch it off I still get just one value, but that value doesn't make any sense.

 

That's when I noticed the variable changes from Position to Positions when I disable Only first one. So, I changed the other actions from %Position% to %Positions% but still no success.

 

Can anyone help me how to get all the values?

  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    Hi @Celia 

    Can you give me example of text? I have a feeling we can get what you need with positive/geatvie lookaheads in regex.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    When you turn off “first one only” you then get %Positions% instead of %Position%. %Positions% is a list, so you would have to do another for each on %Positions% and run your subtext logic through the for each loop so that it does it for each value in %Positions%. 

    good luck. 

  • Pavel_NaNoi Profile Picture
    1,074 on at

    With your method you'll need another "For each" loop that goes through each position and stores the found subtext into a list. A better method would probably to switch to regular expressions in Parse Text, in which the text you'll be looking for would be something like "Work Order :.+($|\n)" as this produces a "Matches" list that contains all the found text straight away without you having to obtain subtext in the first place.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 211 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 190

Last 30 days Overall leaderboard