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 link as is ...
Power Automate
Unanswered

Extracting link as is from dynamic text

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I have a flow that retrieves text from emails. This text is dynamic, meaning it could contain several lines, or no lines. See below for example. I just want to extract the link as is (not including the [ or ] characters). The output currently has several blank lines below the link, and the "View full incident details" above the link is sometimes "View 1 previous incident update" or "View # previous incident updates". Is there a way to only extract the link itself?

 

PeterZigante_0-1660567624411.png

 

My current option would be to create IF statements searching the output for "Full incident details" , " Previous incident update" , and "previous incident updates" then trim based on that. But I think the must be a more efficient/easier solution.

 

Categories:
I have the same question (0)
  • Unknown geen idee Profile Picture
    1,757 on at

    Dear PeterZigante,

     

    Could you not just convert the whole output to a string and then with a split function (Compose) extract the link between the '[' and ']' symbols? You could first find the index point based on '[https:' and '...]', that should be pretty foolproof.

     

    Happy flowing,

    Koen

  • Community Power Platform Member Profile Picture
    on at

    I thought about that, but the text is dynamic, in the screenshot i showed the first line being "Image removed by ... with the .jpg inbetween [ and ]. Sometimes it is only one line, other times this could be 3 or 4 lines. I shortened it as much as i can, now i need to get whatever is between the last square brackets. I was wondering if there was a find link or extract link.

     

     

  • Unknown geen idee Profile Picture
    1,757 on at

    Dear Peter,

    I wonder why you are so concerned with the lines ... with the Slice function as part of the String functions (Expressions under Compose action) you can define a subset of a string based on index points.

    If you first use the Index function based on for example 'http' or some other unique element you can define exactly at which character in your entire string (regardless the total number of lines) you should start/stop the slice .... and thereby capture your link.

     

    Hope this helps,

    Happy flowing.

    Koen

  • Community Power Platform Member Profile Picture
    on at

    Hi Koen,

     

    I have tried this, using the output from screenshot as the first part, then the '[http' as the second, and the ']' as the end. But it says the below error.

    Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language function 'slice' expects its second parameter to be an integer. The provided value is of type 'String'. Please see https://aka.ms/logicexpressions#slice for usage details.'.

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    *Update, i used the split command, using "[https:" and "]" but because i needed https: for the link to work, i just added it afterwards using the output from the initial compose. 

    So it works like this. 

     

    Text to remove [sampletext.jpg]

    More TEXT[to remove]

    [https://urldefense.com ...]

     

    then using Split in a compose based on [https: i was left with below output

    //urldefense.com... 

     

    then just added https: in another action and i was left with below with nothing before or after it

    https://urldefense.com...

  • Unknown geen idee Profile Picture
    1,757 on at

    Dear Peter,

    If it works .... it works.

    BTW, you can easily manipulate the output from 'Index' by adding a number of characters before or after ... in this you can manipulate the position of the slice.

    BTW, you can convert any string to integer by int() function.

     

    If this was a solution to your problem, please indicate in the thread.

    Happy flowing,

    Koen

  • Community Power Platform Member Profile Picture
    on at

    Thank you for the feedback. My issue was that i am unsure the length of the link so i did not want to cut it off, i prefer using string instead of integers. For the moment, it seems what i mentioned does what i need since the text is not always going to be the same, sometimes it will be slightly different. The only constant will be the "[https://urldefense" so using that makes more sense. Thanks again!

  • v-liwei-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    You can use the split function, with https as the delimiter. 

    Finally, use the concat function to connect the obtained result with https.

    I have made a test for your reference:
    1.

    concat('https',first(split(last(split(outputs('Compose_2'),'https')),']')))

    vliweimsft_0-1660894585938.jpeg

    2.

    vliweimsft_1-1660894616819.jpeg

     

    Best Regards,

    Levi

     

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard