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

Links IN an HTML table

Hi all,

 

Normally I create notificaiton emails from a flow that use SharePoint list data I can just create links by using the <a href""> tags, however I am running into a problem where I am trying to include a link to each item inside an HTML table that will go in the body of the email. 

 

  • If I just add the [Link to Item] to the Select Action, I get a working link but it is very long and ugly 🙂
  • If I try to wrap it <a href="[Link to Item]">Link</a> then I get plain text including the tags with no active link.
  • If I try to wrap it <a href=[Link to Item]>Link</a> (no quotes) then I get plain text tags, with the long original link active

Its the end of a long day and I am sure I am missing something obvious, but if you could help me out I would really appreciate it! 

 

screenshot.jpg

7 REPLIES 7
Community Support Team
Community Support Team

Re: Links IN an HTML table

Hi @Creative_Sense,

 

To make a link active in the table, I think the [Link to Item] dynamic content is the only available way so far. 

 

Regards,

Mona

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
DougL
Level: Powered On

Re: Links IN an HTML table

I figured out a work around to this. The reason the HTML Tables are showing as actual text is because they're being HTML encoded.

 

You can undo this by running a "Compose" action after the HTML Table that replaces &lt; with < and &gt; >.

 

For example:

replace(replace(body('Create_HTML_table'), '&lt;', '<'), '&gt;', '>')
 
The danger in doing this is that if there is a place where input originates from a user, they may be able to inject links in what will be sent via email. These could be potentially to malicious sites. Theoretically it may be possible to inject JavaScript this way, but in reality most email clients will not execute scripts within emails.
 
In my particular case I wrote things so the links could only be injected via my transformations in the flow. (I did this by doing a compose replace to completely remove all &lt; and &gt; before injecting my link that would then be HTML encoded). This made it so only the links I wanted in there would have the encoded values and could be reversed back out.
 
 
josephhogans
Level: Power Up

Re: Links IN an HTML table

Of your first three options, which one did you use:

 

 

  • If I just add the [Link to Item] to the Select Action, I get a working link but it is very long and ugly 
  • If I try to wrap it <a href="[Link to Item]">Link</a> then I get plain text including the tags with no active link.
  • If I try to wrap it <a href=[Link to Item]>Link</a> (no quotes) then I get plain text tags, with the long original link activ

 

Creative_Sense
Level: Powered On

Re: Links IN an HTML table

I tried them all and since none worked, I just put a (non-item specific) link to the list in the email above the table. Its not ideal but its better than a giant messy table

hjoel
Level: Power Up

Re: Links IN an HTML table

Thank you! I was able to get this working.

jesusg3
Level: Power Up

Re: Links IN an HTML table

Hi! Thanks for the answer, it worked for me too.

 

I would also suggest to replace ampersands from '&amp;' to '&', as I had to do too.

JBolanos_1970
Level: Powered On

Re: Links IN an HTML table

Nice Solution

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

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 Solution Authors
Top Kudoed Authors
Users online (5,860)