cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Takashi1
Level: Powered On

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
Super User

Re: How to detect end of url

@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
Super User

Re: How to detect end of url

@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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,545)