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.
So I created a lookup column and then in the SharePoint Details form. This would look like this:
Update a Hyperlink Column in SharePoint with Power Automate 1
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
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
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.
Is your business still running on paper trails, sprawling Excel files, or ageing Access databases? There's a better way — and I can show you exactly what it looks like.
I'm the Technical Director of Vantage 365, a Microsoft solutions consultancy working with clients across the UK, the Netherlands, and worldwide.
For over 30 years I've been turning messy, manual business processes into clean, automated systems that save time, reduce errors, and give teams the visibility they need to make better decisions.
SharePains is not just any blog run by a Microsoft MVP. Have you ever used Try-Catch in Power Automate? The original post about Try-Catch in Power Automate can still be found on this site, https://sharepains.com/2018/02/07/try-catch-finally-in-power-automate-flow/
Or have you ever used the Pieter’s method to avoid variables and speed up your flows? https://sharepains.com/2020/03/11/pieters-method-for-advanced-in-flows/
You can contact me using contact@sharepains.com
Is your business still running on paper trails, sprawling Excel files, or ageing Access databases? There's a better way — and I can show you exactly what it looks like.
I'm the Technical Director of Vantage 365, a Microsoft solutions consultancy working with clients across the UK, the Netherlands, and worldwide.
For over 30 years I've been turning messy, manual business processes into clean, automated systems that save time, reduce errors, and give teams the visibility they need to make better decisions.
SharePains is not just any blog run by a Microsoft MVP. Have you ever used Try-Catch in Power Automate? The original post about Try-Catch in Power Automate can still be found on this site, https://sharepains.com/2018/02/07/try-catch-finally-in-power-automate-flow/
Or have you ever used the Pieter’s method to avoid variables and speed up your flows? https://sharepains.com/2020/03/11/pieters-method-for-advanced-in-flows/
You can contact me using contact@sharepains.com