Update a hyperlink or picture column in SharePoint using Microsoft Power Automate (Flow)

2–3 minutes

Setting a hyperlink column’s value using Power Automate is a bit different than setting other column types’ values. In SharePoint, a hyperlink column has two components – address and description. If you update this column type using Power Automate’s “Update item” action, your address and description are both set to the same value.

In SharePoint Designer workflows, we could do this easily with the usual “Set field” action:

But in Power Automate, we only get one field which maps to the URL/address part of the hyperlink field, and is duplicated as the description as well in SharePoint.

And if you’re thinking it could work with a comma, as some other field types might, it won’t. You’ll get “Enter a valid uri.”

To get this to work so we can set both address AND description as separate values, we have to use an HTTP request action instead of (or in addition to) the Update item action. This isn’t as complicated as it may sound. Here are the steps:

1. Add the Send an HTTP request to SharePoint action

2. Choose or enter your site for Site Address

3. Set Method to POST

4. Set the Uri to the following, changing List Name to your list’s name, and replacing [ID] with the ID field from dynamic content

_api/web/lists/GetByTitle('List Name')/items([ID])

5. The easiest way to set your headers is to copy and paste this text into the “Text mode” option as demonstrated in the GIF that follows.

{
   "Content-Type": "application/json;odata=verbose",
   "X-HTTP-Method": "MERGE",
   "IF-MATCH": "*"
 }
Click to enlarge

6. Lastly, in Body, you can copy and paste this as well, but:

  • replace List_x0020_Name with your own list’s name. _x0020_ should replace any spaces in your list name.
  • replace Hyperlink with the name of the hyperlink column’s name
  • replace Google with the label/description/clickable text you want for the hyperlink
  • replace http://www.google.com with the URL/address part of the hyperlink
{'__metadata': {'type':'SP.Data.List_x0020_NameListItem'},'Hyperlink':
 {'Description': 'Google',
 'Url': 'http://www.google.com'}
 }

Your final result should resemble this:

Click to enlarge

Test that out. When it’s working and you’re ready to take it to the next level, you can replace the static url (like Google’s in my example) with dynamic content. For example, you could create convenient one-click links to an item’s version history:

Click to enlarge
Click to enlarge


Discover more from Nate Chamberlain

Subscribe to get the latest posts sent to your email.

7 responses to “Update a hyperlink or picture column in SharePoint using Microsoft Power Automate (Flow)”

  1. […] Setting a hyperlink column on a list automatically to filter the list/library by that item’s vendor/client/topic/etc. for easy comparison/drilldown (see how to set a hyperlink column using Power Automate) […]

  2. Cheryl Shah Avatar
    Cheryl Shah

    Thank you, this post was tremendously helpful!

    One thing I would add is, if the list name has been changed, you have to use the current list name in the api field but the original list name in the body. The column name in the body has to be the internal SharePoint column name. That is what got it to work, for me, anyway.

  3. GG Avatar
    GG

    I tried this and it worked, then I changed the name of the column and did not work again. Now I am getting the following error: The property ‘Description’ does not exist on type ‘SP.File’. Make sure to only use property names that are defined by the type.

  4. macgregor Avatar
    macgregor

    Hey I tried this out and it was working! But then it all of a sudden wasn’t. I changed the name of the list but also changed it in the flow. I’m not a coder so I’m not sure why I’m getting this error now or what it means:

    “A type named ‘SP.Data.Asset_x0020_ApprovalsListItem’ could not be resolved by the model. When a model is available, each type name must resolve to a valid type.”

  5. Tom Schaub Avatar
    Tom Schaub

    Whoo, hoo! This is exactly what I needed. Thank you Nate!

  6. Xerxel Avatar
    Xerxel

    This is genius! Thanks!

  7. […] If you want to populate an actual hyperlink format column with a label/description that’s prettier than the full URL, however, you’ll need to do a bit more work so that you can have both URL and description. Follow the steps in this post on updating hyperlink or picture format columns using Power Automate. […]

Leave a Reply

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

Discover more from Nate Chamberlain

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

Continue reading