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 Platform Community / Forums / Power Automate / How to extract specifi...
Power Automate
Unanswered

How to extract specific line from my multi-line text variable

(0) ShareShare
ReportReport
Posted on by 57

I've done a series of crop text actions to arrive at the below. The final step is to just retrieve line 1 only into it's own variable. So for the end result in this example is a variable with the value "Draft".

 

BenBallantine_0-1677862788015.png

 

I have the same question (0)
  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    You can use the parse text action to find virtually any text in your text variable, even before you "clean" it with previous efforts.

    In your example you could use this pattern to get the first line, check "regex" and "first occurrence only" in the parse text action:

     

    .*\s\s

     

    Alternatively you can split the text into list and then get first element on the list, but regex will do the job in one action 😉

    if you past how the text variable looks before you clean it, we can see if you can get desired value without need to clean 🙂

  • SkSaba Profile Picture
    2 on at

    Hello @BenBallantine  ,

     

    Please let me know if you got a solution for it.

    Thanks,

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    As @momlo correctly pointed out, it can be done much more efficiently with a Parse text action using regular expressions.

    But with the context that we have here, using Split text to split the text with a new line as the delimiter, would convert the text into a list of strings for each line. Then using Set variable to set some new variable as %TextList[0]% would result in the first line of the string.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • prashanth_gr Profile Picture
    2 on at

    Hello @SkSaba @BenBallantine 

    Use parse text and enter .*\s\s in text to find field and disable first occurrence only.

    Then you can access the values in form of Matches[0], matches[1] and so on.

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard