cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User II
Super User II

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

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,419)