Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Extract Text from Email to apply to sharepoint item

(0) ShareShare
ReportReport
Posted on by

Hello Power Users,

I am a novice when it comes to Power Automate and have been only working with it for about a week. I have a great use case for it but am getting stuck trying to figure out how to extract text so I can use that text to update a sharepoint item.

My use case and flow is built as follows, it is a change request form for our customers (open to any feedback on how I am doing this as well):

-Microsoft form sent to customer

-Customer outside our org fills out form, among other things listing their email and the email of another authorized contact

-get response details and use them to send an email with options to the other authorized contact that was put down in previous step so they can approve the change request (we require two approvals, I know this could be easily spoofed but working within what I have figured out so far)

-Once we have obtained customer approvals another email with options is sent internally for approval to a distro

-If approved, another email with options is sent to the approver to select from a list of individuals to assign to the change request

-acknowledgement of approval sent to customer

 

Up to this point is where I get stumped. We have a ticketing system where I can send an email to a distro and get an autoreply back with a ticket number. What I would like to do is grab the ticket number from that email so I can add it to the next step where a sharepoint item in a list is created

 

I have found "get email" and "get emails" as actions but they do not seem geared for what I am trying to accomplish

 

Below are screenshots of my flows if what I explained was hard to follow.

 

Thank you

 

pic 1 of 5pic 1 of 5pic 2 of 5pic 2 of 5pic 3 of 5pic 3 of 5pic 4 of 5pic 4 of 5pic 5 of 5pic 5 of 5

  • Community Power Platform Member Profile Picture
    on at
    Re: Extract Text from Email to apply to sharepoint item

    @RhiassuringYOU ARE AMAZING THANK YOU! That did the trick and I am getting the exact output I need to build out and polish the rest of this flow. Never would have figured it out without your help!

  • Verified answer
    Rhiassuring Profile Picture
    8,688 Super User 2025 Season 1 on at
    Re: Extract Text from Email to apply to sharepoint item

    I'm imagining that your output from your email will look like "We have opened ticket nbsp;#####" ... encoding that the email dropped in, so I guess we could replace the "Before" text with "opened ticket nbsp;" and change the 22 to 19. 

    Sorry I'd try it out right now, but, I just got back from a run and I'm super smelly - so - hope you'll give that a shot and let me know the outcome 🙂 Seeing the raw output from your Get Email body would be helpful too (just the parts around the ticket # - I want to see if the nbsp; is in there, and if there's any other encoding we need to look out for.)

  • Community Power Platform Member Profile Picture
    on at
    Re: Extract Text from Email to apply to sharepoint item

    @Rhiassuringso I added a 4 minute delay which seems to be within the amount of time it takes to get the auto reply but am still getting "nbsp;1371" as the extracted text instead of the ticket #. Anything you can see below that would be preventing this from executing correctly?

    delay.pngdelay 2nd half.png

  • Rhiassuring Profile Picture
    8,688 Super User 2025 Season 1 on at
    Re: Extract Text from Email to apply to sharepoint item

    The action name is "Delay" - You will be able to tell it to wait 5 minutes, for example. 

    (Also, wow, I couldn't remember the name for the life of me - tried wait, duration, pause... haha.)

  • Community Power Platform Member Profile Picture
    on at
    Re: Extract Text from Email to apply to sharepoint item

    @RhiassuringLooks like we are almost at the finish line! Is there a way to add a pause or delay into the flow? I tried testing this earlier and it seems like the flow ran correctly but finished before I got the auto-reply email to grab the ticket number from. Below is what was in the email I set as the "acknowledgement" to the customer saying we have approved their request with X ticket number and Y engineer (highlighted portion was grabbed with the substring stuff):

    Change request for Test Change Name at Test Location - Ignore on 2022-06-16, 2-4PM CST has been approved.

    Ticket Number: nbsp;1371

    Your assigned engineer will be Eng1 and will reach out to you shortly

     

    edit: added more clarity

  • Rhiassuring Profile Picture
    8,688 Super User 2025 Season 1 on at
    Re: Extract Text from Email to apply to sharepoint item

    Ahhh, right, you'll need to "Get Email" after you "Get Emails". It's kind of like the Forms actions, if you've used those before.


    So, you have your Get Emails action - perfect. And you know you'll only get one, right? (Make sure the "Top" is equal to "1") 

    Now that you've identified the email, to make this cleaner, let's use the "Compose" and then "Get Email" action. Since you've gotten your emails, you can now use the message ID - but Power Automate is kind of a nerd and assumes everything is more than 1, even when we've told it to only get the first one. 

    Rhiassuring_0-1649274924626.png


    When you plop your email into the bottom of this, you should be able to use the (in your screenshot) "Substring - Remove everything after the ticket number" right into it. 





  • Community Power Platform Member Profile Picture
    on at
    Re: Extract Text from Email to apply to sharepoint item

    @Rhiassuring  awesome that cleared it up! Thank you so much for all your help! I got this all set up correctly I believe, last part that is escaping me is what to select in terms of dynamic content to insert the ticket # into following actions. Once I nail that down I should be able to test the entire flow

    get email.pngget text from email.pngchng request approved.png

  • Rhiassuring Profile Picture
    8,688 Super User 2025 Season 1 on at
    Re: Extract Text from Email to apply to sharepoint item

    Oh! Sorry I should have explained - you won't need the variable, that's just my way of mimicking your email body. For you, where ever I use "txtFakeEmail", you'll use your email's body instead.

  • Community Power Platform Member Profile Picture
    on at
    Re: Extract Text from Email to apply to sharepoint item

    @RhiassuringAwesome thank you! Please excuse my ignorance but where would I nest these additional actions? I presumed to place it after get emails v3 but am getting hit with this error "The operation 'Initialize variable' can only be used at top level." Do I need to create a separate flow that is triggered by my existing flow?

    2022-04-05 16_46_42-Edit your flow _ Power Automate — Mozilla Firefox.png

     

     
     
  • Rhiassuring Profile Picture
    8,688 Super User 2025 Season 1 on at
    Re: Extract Text from Email to apply to sharepoint item

    Definitely makes it easier!  Also, I keep forgetting there are now actions for substring & find text, so you don't even need to compose if that's not your jam. 

    Rhiassuring_0-1649194455789.png

     

    This gets the 9 characters after it sees "We have opened ticket ". If the length of the ticket number is always the same, this will work for you. If that's not the case, please let me know, and I'll scrap the other option together. 

    Cheers,

    Rhia

     






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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,700 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow