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.
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!
Hi @Anonymous,
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
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 < with < and > >.
For example:
replace(replace(body('Create_HTML_table'), '<', '<'), '>', '>')
Of your first three options, which one did you use:
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
Thank you! I was able to get this working.
Hi! Thanks for the answer, it worked for me too.
I would also suggest to replace ampersands from '&' to '&', as I had to do too.
Nice Solution
Can you please share the image of output and code Thanks 🙂
As It is observed, CreateHTMLTable converts < to < and > to > when reading data from array, as it considers < and > as a input data.
While to have <a> markup to work, replace approach works every time.
Example Table contains -
{
...
link : "<a href= \"https://samplelink.tonewplace.com/person\">click here</a>"
...
}
gets converted to something below due to CreateHTMLTable -
<tr><a href= "https://samplelink.tonewplace.com/person">click here</a>
So, When we replace as said earlier
Example table becomes -
{
...
link : "::a href= \"https://samplelink.tonewplace.com/person\":;click here::/a:;"
...
}
After CreateHTMLTable, result is similar to -
<tr>::a href= "https://samplelink.tonewplace.com/person":;click here::/a:;
So, now using Compose to replace the combination of characters, used earlier -
<tr>::a href= "https://samplelink.tonewplace.com/person":;click here::/a:;
becomes -
<tr><a href= "https://samplelink.tonewplace.com/person">click here</a>
Now above result can successfully be used as part of email. This method relies on combination of characters used for < and > respectively, so choose carefully as per data that needs to be shared over email.
This solution worked perfectly for me.😊
Hi. I have followed the steps above and cannot get it to work. I just get the following txt in my email
<a href="https://xxx/sites/xxx/Shared%20Documents/1xxx/filename.pptx?" Link</a>
How did you get yours to work?
User | Count |
---|---|
95 | |
46 | |
21 | |
18 | |
17 |
User | Count |
---|---|
140 | |
50 | |
42 | |
39 | |
29 |