cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
biomorph00
Regular Visitor

Extract IMG URL from html

Hi,

We get html text from a SharePoint list multi-line text field.

Inside this html are multiple image tags, like this (html shortened):

 

 

<p><span><img src="https://test.sharepoint.com/sites/testsite/ImagesList/test1_1583224291784.png" alt="" /></span></p>

 

 

Does anyone know how I can extract each image tag URL, bearing in mind that the image could be JPEG, GIF, PNG etc...

I expected to be able to do this easily with regex, but there isn't a regex option in Flow yet.  I cannot use the Plumsail regex connector or use a separate azure function (cloud governance issues) so have to do with what is out of the box in flow.

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User
Super User

Hi @biomorph00 

 

Try this. As I mentioned earlier you can do this in different ways.

 

image.png

 

The above expressions are as follows:

 

split(outputs('Compose_2'),'=')
 
replace(replace(outputs('Compose')[1],'https://test.sharepoint.com/sites/testsite/ImagesList/',''), 'alt', '')
 
My test result:
image.png


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

4 REPLIES 4
abm
Super User
Super User

Hi @biomorph00 

 

You do this couple of ways.

 

Is your SharePoint URL is fixed then use a replace function to replace the URL with ''. 

 

Once that is replaced then use the Split function to get the image name.

 

use the split separator as '"' (double quotes)

 

OR

 

You could do everything using replace

Your first replace will be replace the below with ''

<p><span><img src="https://test.sharepoint.com/sites/testsite/ImagesList/

Then use the above output to replace the below with ''

" alt="" /></span></p>

Finally you will have the filename

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
abm
Super User
Super User

Hi @biomorph00 

 

Try this. As I mentioned earlier you can do this in different ways.

 

image.png

 

The above expressions are as follows:

 

split(outputs('Compose_2'),'=')
 
replace(replace(outputs('Compose')[1],'https://test.sharepoint.com/sites/testsite/ImagesList/',''), 'alt', '')
 
My test result:
image.png


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
abm
Super User
Super User

Hi @biomorph00 

 

You could pass the HTML content to HTML to text action then use the split using '/' delimiter to get you the image name.

 

image.png



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
biomorph00
Regular Visitor

Many thanks abm!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (1,777)