How to update SharePoint hyperlink column in Power Automate

“I built a Power Automate flow that copies excel rows to a SharePoint list, but I can’t get the hyperlink column to work. It should both have a description, and a link, but I don’t know how to update it.”


When you use the ‘Hyperlink’ column is SharePoint, it’ll ask for two values, URL and Alternative text, but the ‘update’ action in Power Automate has only a single field.

Power Automate update Sharepoint hyperlink column

And if you try to put in both the values, URL and Alternative text, you’ll end with an error message.

While it might seem as the error message is giving you a hint on proper format (..type ‘String/uri’), it’s not. It doesn’t mean that you should use format [Alternative text]/[URL] to update the column. It tells you that it expects a String if form of a url. Just the url which will be then displayed in the column. You can’t update the Alternative text into the hyperlink column. So what are the workarounds?

Multiple lines of text field

One option is to get rid of the ‘Hyperlink’ column. If it’s updated by a Power Automate flow, then you don’t need the fancy update form. You can use Multiple lines of text column with Rich text enabled instead. Enabling Rich text allows you to use HTML code in the column, including usage of links, as shown by the code blow.

<a href="[URL]">[DisplayText]</a>

Note:
[URL] is your dynamic content with the link
[DisplayText] is your dynamic content with the 'Alternative text'

JSON formatting

The other option is to use JSON formatting on the ‘Hyperlink’ column. When you update the column with the URL, it’ll display the URL. But using JSON formatting you can change what will be shown to the users while the URL will stay in the background. Using the formatting below you can go from URL to ‘Link’ text with the URL behind.

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "a",
  "txtContent": "Link",
  "attributes": {
    "target": "_blank",
    "href": "@currentField"
  }
}
Power Automate Sharepoint hyperlink update JSON

You can find more information on the JSON formatting in my previous post on building calculated hyperlink column.

Summary

While Power Automate doesn’t allow you to update the ‘Hyperlink’ SharePoint column in the same way as users would, there’re still workarounds. As long as users don’t need to update the columns themselves, there’s not much of a difference. From the user perspective, both options will hide the URL behind the text.

But if the users must be able to update the link, then I’d say the JSON formatting is a better choice. Users don’t need to mess with HTML or Rich text editor, they’ll just update the link in the column and JSON will take care of the rest.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to a special content like a SharePoint Filter Query cheat sheet.

Zero spam, unsubscribe anytime.

Add a Comment

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