Update a hyperlink column in SharePoint with Power AutomateUpdate a hyperlink column in SharePoint with Power Automate

Today, I was asked about how to create a lookup to a document or item in a SharePoint form. Sometimes a slightly different solution, using a Hyperlink field can do the trick.

Lookups in SharePoint

So I created a lookup column and then in the SharePoint Details form. This would look like this:

Lookup column in a form

Not too bad!?

But when I click on that lookup I get presented with one of these ugly dialogs from SharePoint 20XX. That is not what we want.

Clicking on a lookup column gives classic SharePoint UI dialog
Clicking on a lookup column gives classic SharePoint UI dialog

So how do we create a link that gets us directly to the document that I linked to?

Lookups are limited to display simple fields and fields like links to items/documents are not available. So there isn’t much we can do here. Also Calculated columns do not support the links that we are after.

Hyperlinks to the rescue!

Create a Hyperlink field

So first in SharePoint you can create a Hyperlink field.

Create a Hyperlink field
Create a Hyperlink field

The big difference of course between a Hyperlink field and a Lookup is that there isn’t a set number of values that you can select from. But in this case that was fine. The lookup was set as part of a flow in Power Automate anyway.

Update Hyperlink field in SharePoint

We will have to use the SharePoint REST API to do the update, to ensure that we have the description of the the Hyperlink available to us.

First, I’ve created my Hyperlink as shown earlier and I called this HTML URL. Then using the Send an HTTP request to SharePoint I’m going to set the Hyper link property.

flow in Power Automate to set a Hyperlink column.

Notice that there is no need to used odata=verbose in the Content-Type header. I see many people defaulting to use this verbose switch, but that just makes the update more complicated.

And with the above flow we can fairly easily update our Hyperlink field.

Avatar for Pieter Veenstra

By Pieter Veenstra

Business Applications Microsoft MVP working as the Head of Power Platform at Vantage 365. You can contact me using contact@sharepains.com

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains by Microsoft MVP Pieter Veenstra

Subscribe now to keep reading and get access to the full archive.

Continue reading