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 / How to select a specif...
Power Automate
Answered

How to select a specific text from web page

(0) ShareShare
ReportReport
Posted on by 54

Hi All,

 

I am new to PowerAutomate and this is my first flow. I am trying to extract a specific text value from a web page. Right now I am able to extract the complete sentence using 'Extract data from web page' or 'Get details of element on web page', however I am interested in parsing the specific text value.

 

E.g. Please accept my order with order no 123456 and phone number 8573454567.

 

I wan to extract 123456 and 8573454567.

 

Thanks,

Awadhesh

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

    If you are sure your order and phonenumber are always 6 and 10 digits you can do it like this after you have extracted the string from the web page. (Use your extracted data from the web page, not the teststring😊)

    This is just an example, to give you an idea
    Highboy_0-1635233796511.png

     

  • awadheshyona Profile Picture
    54 on at

    Thanks @Highboy  This should help. I will give it a try, however can you please help if there is any way to do it  without parsing it(something like PowerAutomate functionality).

    Mostly the length will remain same but they can be in any order and also the sentence may change.

     

    E.g. Accept with phone number 8573454567 and order no 123456 

  • Highboy Profile Picture
    1,187 Super User 2024 Season 1 on at

    Using the one below picks the order and phonenumber correct, regardless of the order in the text.

    Highboy_2-1635247558287.png

    Picks exactly 6 consecutive digits (?<!\d)(\d{6})(?!\d)

    Picks exactly 10 consecutive digits (?<!\d)(\d{10})(?!\d)

     

    You can play around with it on https://regex101.com/

     

     

     

  • Verified answer
    awadheshyona Profile Picture
    54 on at

    Thanks @Highboy You have been really helpful.  That will work 90% of time, however I have few scenarios where length is not consistent (I have email id as well which I need to extract) e.g. order 1234 and phone number might have dashes e.g . 857-345-4567 . I also have some cases which even have blank value and I have to extract if that information is blank or not.

     

    e.g. Please accept order 12234 with phone no: 

  • Verified answer
    MichaelAnnis Profile Picture
    5,727 Moderator on at

    Look at the Parse Text rules; I am sure you can find an expression that will fit all forms of phone numbers with various parenthesis, dashes, dots, etc.

     

    If you can't, then I would use nested If's for which format you can find.  Ex.

    • If Parse Text d10 is empty
      • If Parse Text ddd-ddd-dddd is empty
        • If Parse Text (ddd)ddd-dddd is empty
          • Phone number = "blank"
        • End
        • Get phone number
      • End
      • Get phone number
    • End
    • Get phone number

     

    Same goes for your other items:

    • If Parse Text (for order number) is empty
      • Set variable Order Number to "blank"
    • End

    Hope this helps.

     

  • Pavel_NaNoi Profile Picture
    1,074 on at

    Tough one if its as dynamic as you say, I'll also just throw in a couple of suggestions, see if any of them stick:

    - If its a UI Element use an "Get details of element on webpage" action and select it, this will save the text.

    - Extract all the text and use a parse to match for any digit number occurrences, then calculate the respective length of the numbers, I'll assume here that phone number length is always > than order number length and you can use an if statement decision that simply says what is what based on that condition.

     

    Hope this helps.

  • Highboy Profile Picture
    1,187 Super User 2024 Season 1 on at

    May I suggest some kind of data sanitizing?
    But you can get a long way with regex, but you need to know what format you can expect.

    Where are the data comming from?

     

  • Highboy Profile Picture
    1,187 Super User 2024 Season 1 on at

    You could use ^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$ to validate the email - but there are lot's of other regex examples for email extraction.

  • awadheshyona Profile Picture
    54 on at

    Hi @Highboy @MichaelAnnis @Pavel_NaNoi  Thanks.All of your suggestions were really helpful . Can you please help me what is wrong in below reg expression for email. I am not getting any value in my variable.

     

    /([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/Parse Email.JPG

  • Highboy Profile Picture
    1,187 Super User 2024 Season 1 on at

    Just skip the first and last /
    This works for me
    ([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)

     

     

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 227

#2
David_MA Profile Picture

David_MA 204 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 177

Last 30 days Overall leaderboard