cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

How to detect end of url

I am trying to post the message into Microsoft Teams whenever recieving email messages from certain system, using Flow bot.
This message always contains URL, and needs to convert the URL to markdown so that posted message in Teams contains clickable URL (not just text).

I understand we can use the markdown to specify the beginning of the URL as:
replace(variables('TransBody1'),'https:','[Please click here to see the contents](https:')

But having difficulty specifying the end of the URL, as URL is getenarated randomly with unique ID each time, such as "https://foo.com/test.asp?ID=23" where the last ID number always changes.
This is preventing from making a markdown TransBody as URL ending can not be specified.
replace(variables('TransBody2'),'ID=RAMDOM_ENDING_ID','ID=RANDOM_ENDING_ID)') <== where "RAMDOM_ENDING_ID" is unique number each time...

Is there a way to grab the variable string in Flow?

Thank you in advance.
1 ACCEPTED SOLUTION

Accepted Solutions
Super User II
Super User II

@Takashi1 

Hi there!  So, probably a couple of ways to do this depending on your comfort level.  You seem fine with expressions (which I'm not)...but it feels like we could probably do some string manipulation using "indexof" and/or "lastindexof" to find the positions of "?ID=" and whatever character follows the end of the URL, then use "substring" to single out those bits with a bit of math (to figure the length of the ID).

 

Another option would be a parsing tool like Parserr or Plumsail to do essentially the same thing, but with a friendlier interface.

 

Do either of those sound good?

 

-Ed-

 

 

If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

1 REPLY 1
Super User II
Super User II

@Takashi1 

Hi there!  So, probably a couple of ways to do this depending on your comfort level.  You seem fine with expressions (which I'm not)...but it feels like we could probably do some string manipulation using "indexof" and/or "lastindexof" to find the positions of "?ID=" and whatever character follows the end of the URL, then use "substring" to single out those bits with a bit of math (to figure the length of the ID).

 

Another option would be a parsing tool like Parserr or Plumsail to do essentially the same thing, but with a friendlier interface.

 

Do either of those sound good?

 

-Ed-

 

 

If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (3,335)