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 / Extracting URL from em...
Power Automate
Unanswered

Extracting URL from email body text

(0) ShareShare
ReportReport
Posted on by

Hello

I'm trying to set up a flow where when an email is flagged a new task is created in Planner. So far I've managed to set up the flow successfully whereby it pulls all of the email body text (converted from HTML to text) into the description of the task but I'd ideally like it to just be the URL from within the email. 

I've tried following this solution: https://powerusers.microsoft.com/t5/Building-Flows/Extract-URL-from-Email-body/m-p/695681#M94225 but something just isn't working for me. I only have 'Compose' action and not 'Compose - Trim Start' or 'Compose - Replace Chars':

LaurenAddison_1-1618850251685.png

This is my current flow:

LaurenAddison_2-1618850326387.png

Can anyone help me please!?

Categories:
I have the same question (0)
  • Paulie78 Profile Picture
    8,422 Moderator on at

    Would you be kind enough to post the raw outputs of the HTML to text action? Then we can see if we can make an expression to pull out the URL? If possible use the code window to post it.

    2021-04-19_17-55-22.gif

  • Community Power Platform Member Profile Picture
    on at

    Thanks for responding!

    I think one of these are what you were looking for? The URL is a Google Docs link.

    LaurenAddison_0-1618851914579.png

     

     

  • Paulie78 Profile Picture
    8,422 Moderator on at

    lol, that is a bit more than I was looking for, but that will do. 😂

  • Paulie78 Profile Picture
    8,422 Moderator on at

    Are you trying to grab:

    https://docs.google.com/document/d/1Coy_qI5qUAFlMbh2CLWP73Bs9ecK5vlevhaGBhcITx4/edit?usp=sharing

    Correct? 

    As you are parsing a human written email, this is likely to wrong in future, but I can make you something that will pull that out of the email in this instance?

     

  • Community Power Platform Member Profile Picture
    on at

    Yes, that's what I'm trying to extract and yes, please can you help me with this instance.

  • Paulie78 Profile Picture
    8,422 Moderator on at

    ok, try this:

    • Copy the code below to your clipboard.
    • Add a new action in your flow after your "HTML to text" action"
    • Click on my clipboard.
    • Click paste.

    A bit like this:

    2021-04-19_06-56-02.gif

    Except your one is called getURL. Because a couple of the concepts are a little complicated I have separated the actions into different steps, so you can better understand what is going on.

     

    After you paste, you will have a scope which will contain the steps that give you the URL, but these are intended to be chained off the action, HTML to text, so must go after it.

    {"id":"2b75eb54-de4b-4cb5-8ab0-96c4-e6bf1982","brandColor":"#8C3900","connectionReferences":{"shared_conversionservice":{"connection":{"id":"/providers/Microsoft.PowerApps/apis/shared_conversionservice/connections/shared-conversionser-8c945934-2489-4e84-98ab-725c-31760fc1"}}},"connectorDisplayName":"Control","icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KIDxwYXRoIGQ9Im0wIDBoMzJ2MzJoLTMyeiIgZmlsbD0iIzhDMzkwMCIvPg0KIDxwYXRoIGQ9Im04IDEwaDE2djEyaC0xNnptMTUgMTF2LTEwaC0xNHYxMHptLTItOHY2aC0xMHYtNnptLTEgNXYtNGgtOHY0eiIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo=","isTrigger":false,"operationName":"getURL","operationDefinition":{"type":"Scope","actions":{"startPos":{"type":"Compose","inputs":"@indexOf(outputs('Html_to_text')?['body'], 'https://docs.google.com')","runAfter":{}},"endPos":{"type":"Compose","inputs":"@indexof(substring(outputs('Html_to_text')?['body'], outputs('startPos')), 'sharing')","runAfter":{"startPos":["Succeeded"]}},"URL":{"type":"Compose","inputs":"@substring(outputs('Html_to_text')?['body'], outputs('startPos'), add(outputs('endPos'),7))","runAfter":{"endPos":["Succeeded"]}}},"runAfter":{"Html_to_text":["Succeeded"]}}}

    See how you get on.

  • Community Power Platform Member Profile Picture
    on at

    Thanks for this! I copied the code and then went to Power Automate, but its just showing me this: 

    LaurenAddison_0-1618853202087.png

     

  • Paulie78 Profile Picture
    8,422 Moderator on at

    Are you sure you copied the entire code? If you miss one character it will not appear, if it does not work for you I will screenshot it.

  • Community Power Platform Member Profile Picture
    on at

    This is what I'm doing and still no luck:

    LaurenAddison_0-1618853499726.png

     

  • Paulie78 Profile Picture
    8,422 Moderator on at

    Not sure what is going on there, another user just tested pasting it for me and it worked for them. Will do you some screenshots, but can't do it right now. Will post screenshots in about an hour.

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