cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

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

8 REPLIES 8
Highlighted
Community Support
Community Support

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.
Highlighted
Advocate I
Advocate I

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.
 
 
Highlighted
New Member

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

 

Highlighted
Advocate II
Advocate II

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

Highlighted
New Member

Re: Links IN an HTML table

Thank you! I was able to get this working.

Highlighted
Anonymous
Not applicable

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.

Highlighted
Regular Visitor

Re: Links IN an HTML table

Nice Solution

Highlighted
Helper I
Helper I

Re: Links IN an HTML table

Can you please share the image of output and code Thanks 🙂

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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!

Top Solution Authors
Top Kudoed Authors
Users online (7,490)