Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Solution
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

How to add hyperlink in the ‘Create HTML table’ Power Automate action

Posted on June 16, 2021June 16, 2021 by Tom

“I’ve got all the items in a single HTML table, but I’d like to include also clickable hyperlink to the items, is that doable with Power Automate?”


The Power Automate action ‘Create HTML table’ should allow you to display data in an ‘easy to read’ format. But as already shown on the multiple people picker or choice SharePoint columns, sometimes it’s not that easy. If you use the HTML table to send data to users, you might need to format them it a bit. And another value that needs formatting is the link to the related item / document. You probably don’t want to send the whole link, and this post will show you how to avoid it.

Power Automate HTML table hyperlink

Note: All the examples below will use a SharePoint list as the data source.

Format the link with HTML tags

Since you’re building an HTML table, you should stick to that format and build the link in HTML format too.

<a href="Link">Text to display</a>

Using Power Automate, such a string can be built with the concat(…) expression from the various pieces.

concat('<a href="', [Link], '">[Text]</a>')

Replacing the placeholders with actual values, the expression might look like below.

concat('<a href="', item()?['{Link}'], '">Link to item</a>')

But this is only the first step of the solution. If you end here, you’ll make the link even uglier as you can see below. The action took the string as it is, without applying the HTML tags.

What happened is that the HTML table doesn’t want you to add another HTML tags as they could break the table. To stay safe it replaced the < with &lt;, > with &gt; and “ with &quot;. It’s just another representation for these characters, but it’s enough for the table to ignore the additional HTML code with the hyperlink. That leads to the 2nd step, you must replace the characters back.

Return the <, > and ” characters

To hide the links and show only the text (with link in the background), you must get back the <, > and ” characters. That means using the replace(…) expression on the ‘Create HTML table’ output to replace the &lt;, &gt; and &quot;.

1. replace(body('Create_HTML_table'),'&lt;','<')
2. replace(body('Create_HTML_table'),'&gt;','>')
3. replace(body('Create_HTML_table'),'&quot;','"')

or all together in a single expression:
replace(replace(replace(body('Create_HTML_table'),'&lt;','<'),'&gt;','>'),'&quot;','"')
Power Automate HTML table hyperlink

Use another dynamic content as the text

Now, when you know how to hide the link behind a text, you can adjust also the text itself. The easiest way is to have a static text for the link, but it’s not necessary. You can use another dynamic content as the text too, just add it to the concat(…) expression, e.g. the item title.

concat('<a href="', item()?['{Link}'], '">', item()?['Title'], '</a>')
Power Automate HTML table hyperlink

Summary

I’d say this post is an addition to the previous post on formatting the HTML table. When you use Power Automate to send reminders or reports with an HTML table, it makes sense to include also hyperlink. It’ll change a purely information email into an actionable email, and the recipients will save a lot of ‘search time’. Quick overview of the most important values and a link to see them all.


🚀 Master Power Automate

Join 2,100+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

30 thoughts on “How to add hyperlink in the ‘Create HTML table’ Power Automate action”

  1. Brian says:
    August 17, 2021 at 11:17 pm

    Excellent solution, thank you!

    Reply
  2. Colleen says:
    October 28, 2021 at 6:39 pm

    This is EXACTLY what I was looking for. Thank you!

    Reply
  3. Tom Kaphingst says:
    December 22, 2021 at 3:48 pm

    This is great, I have a need to add multiple attachment links per item. How is that processed/ how would I process that?

    Reply
    1. Tom says:
      December 30, 2021 at 9:52 am

      Hello Tom,
      you’d use the same approach, but you’d have more rows in the ‘Create HTML table’ action where you build the additional links in the same way with the concat(…) expression.

      Reply
      1. MVP says:
        November 7, 2024 at 10:14 am

        Thanks, its so helpful

        Reply
  4. Kayla says:
    March 25, 2022 at 11:37 pm

    Thank you so much!

    Reply
  5. Oscar says:
    May 15, 2022 at 7:51 pm

    Not sure where you are saying we put the replace, replace commands in. If I do in the body of the email, I still get the long URL. And then where do you ever pull the output from as in the replace, replace command you gave, I see reference to create html table but nothing about the output.

    Reply
    1. Tom says:
      May 17, 2022 at 8:37 am

      Hello Oscar,
      the long replace(…) expression should be in the email body, but for it to do anything you must use also the concat(…) in the ‘Create HTML table’ action that’ll prepare the string with the characters to be replaced.

      Reply
  6. Alex says:
    May 25, 2022 at 12:19 am

    Hi Tom, first of all congrats for the post.

    Second thing: I did exactly what you said. An email is sent out with the Custom HTML table and the hyperlinks created the way you state, including the replace replace replaces, etc.

    But once it arrives to my Inbox, be it Gmail or Yahoo, the links are simply not clickable . Or when clicking on them, nothing happens. No browser page gets opened with the link.

    And this happens in Gmail , or Yahoo, and using them from either my Desktop Outlook or via browser.

    Any idea?

    Best,

    Alex

    Reply
    1. Tom says:
      June 1, 2022 at 5:29 pm

      Hello Alex,
      the links are build using HTML coding so every client that supports HTML emails should handle them. I’m surprised that it doesn’t work in the clients, does it look like a valid HTML when you check the email code?

      Reply
  7. Olga Melo says:
    June 7, 2022 at 10:49 pm

    You are brilliant!
    I just copy paste and got a perfect working solution.
    Thank you very much for all the content you share.

    Reply
  8. Mike says:
    June 11, 2022 at 3:53 am

    Awesome blog! You saved me much hair

    Reply
  9. Alyssa Siegel says:
    July 19, 2022 at 1:04 pm

    So appreciate your help! I googled when I got stuck, found this page, and had done everything you did already up until you said “But this is only the first step of the solution.” Thanks for helping me cross the finish line!!

    Reply
  10. John says:
    August 8, 2022 at 10:45 pm

    Awesome! Just what I needed!

    Reply
  11. nicheplayer says:
    September 29, 2022 at 8:38 pm

    Thank you for posting this; it’s great.

    Reply
  12. Donna says:
    January 30, 2023 at 5:16 pm

    Thanks for this, super helpful.
    I was wondering how you would also apply a colour? For instance if you have a Priority column and want Critical items in red, High in Orange and Low in Green?

    Thank you

    Reply
    1. Tom says:
      February 9, 2023 at 9:41 pm

      Hello Donna,
      it’s doable with a condition, take a look on this blog post where I change colours depending on the result of a calculation: https://tomriha.com/format-results-of-date-calculation-in-sharepoint-column/, in your case you can just check the value of the column, e.g.
      “style”: {
      “color”: “=if(@currentField == ‘xxx’, ‘#00FF00’, if(@currentField == ‘yyy’, ‘#FFA500’, ‘#ff0000’))”
      }

      Reply
  13. Doan says:
    July 27, 2023 at 12:33 pm

    Awesome! Just exactly what I needed.

    Reply
  14. Dee OD says:
    September 27, 2023 at 10:33 pm

    Just found this and it’s a huge help! However, when I enter the replace(replace(replace line into the expression box, it says the expression is invalid. Any ideas?

    Reply
    1. Tom says:
      October 22, 2023 at 3:49 pm

      Hello Dee OD,
      no ideas as I don’t know what exactly did you enter in the expressions box.

      Reply
  15. Lucas says:
    November 14, 2023 at 4:21 pm

    Hi Tom! I´m amazed how clear you´ve made this post.
    I´ve tested it with the function “Get Item” just to get one entry of data and it worked perfectly.

    Now I´m struggling with the function “Get Items” when the output is multiple registers and multiple URLs.
    How did you pass the data to the HTML is not clear.

    I´ve searched through your blog, but couldn´t find a way to do it.

    I´ve done it with this flow: “Get Items” > “Select” > “Initialize Variable” > “Create HTML Table” automatic columns > “Append to string variable” > “Teams Message in a chat”
    But when i put the selected values as custom values for columns on the HTML Table, it makes it inside a “For each” and i cannot format the HTML as you teaches.

    Reply
    1. Sean says:
      August 30, 2024 at 6:17 am

      Hi Lucas,
      To avoid ‘For each’ action, I think you should use expression: items()?[‘column name’] instead of using dynamic value.

      Reply
  16. Alex says:
    November 20, 2023 at 10:41 pm

    The hyperlink worked as expected and the automated email looks so much better now. Thanks for sharing this!

    I do have question… how did you figure this out? Was it through trial and error or did you refer to some other document that pointed you in the right direction? I am curious to know because I would not have figured this out on my own.

    Reply
  17. Robyn Polk says:
    December 19, 2023 at 5:05 pm

    I’m trying to create a link to go to an event on a calendar in Outlook within the HTML table of Power Automate workflow but can’t seem to figure out the right syntax for it. Any idea on how to do that would be appreciated.

    Reply
  18. Tyler says:
    January 27, 2024 at 12:14 am

    Well done! Thank you for sharing this.

    Reply
  19. Nate says:
    February 12, 2024 at 7:25 pm

    I also have a compose step to format the table using css. When inputting the replace formula in email body I getting the table added twice. one with raw html link and one with the link shortened properly.

    Reply
    1. Tom says:
      February 28, 2024 at 9:17 am

      Hello Nate,
      if it’s twice in the email then you must use it twice in the flow, maybe it’s included also in the css ‘Compose’?

      Reply
  20. Prashant says:
    June 13, 2024 at 6:01 pm

    This is exactly the detailed explanation with example I was looking for. Thank you so much.

    Reply
  21. Cory B McConnell says:
    July 17, 2024 at 9:40 pm

    I appreciate this detailed solution.
    I recently found another use case and could NOT make it work again and I was really banging my head against the wall. The difference was that I was using the ‘new’ designer in Power Automate. Switched back the ‘old’ one and it worked fine.

    Reply
  22. Pingback: Checklist for Power Automate reminder flows

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

🚀 Master Power Automate

Join 2,100+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Still exchanging emails to get things approved?

Get the Approval Process solution and the Task Delegation App to skip the hard part and deploy an automated, fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundle—everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes