How to update SharePoint hyperlink column in Power Automate
Posted On December 6, 2020
“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.
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.
[URL] is your dynamic content with the link
[DisplayText] is your dynamic content with the 'Alternative text'
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.
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.