“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.
<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"
}
}
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.
Hello Tom,
I have created a flow that should update one of the columns with link. Flow runs successfully but the column is not updated. Do you have any idea what might be the problem here?
Hello Joanna,
the output of the HTTP request action should give you some information about what happened, but as long as the format is correct and the column is a hyperlink column it should work.
Hi Tom
If I want to pass the entire rich text field in an email message and send the email with the body showing the entire rich text field value, how can I convert the rich text field to json format? If I just use the Dynamic Content “Message” (which is the field name), I got an error saying that The response is not in a JSON format.
Hello Peyyi,
you can’t convert rich text (which is an HTML code) to JSON, that’s completely different formats and converting from one format into another is not an easy task as they’re completely different.