web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :

HTTP Request to SharePoint - Alternate Hyperlink Method

RachelSchulz09 Profile Picture RachelSchulz09
Scenario: You want to fill or update a hyperlink field on a SharePoint list or library using the Send an HTTP request to SharePoint action, and you want to specify both the url and display text.
 
I found many solutions for using an existing hyperlink field's contents, like this:
 

 
{
  "formValues":[
    {
      "FieldName": "Link",
      "FieldValue": "[your hyperlink content from another action]"
    }
  ]
}
 
I had a hard time finding how to construct the JSON when I wanted to specify the url. Most places will instruct you to break up the hyperlink into its parts, like this:
 
{
  "__metadata": { "type": "SP.Data.YourListNameListItem" },
  "YourInternalColumnName": {
    "Description": "Your Display Text",
    "Url": "https://yourlink.com"
  }
}
 
If your web search doesn't include "formvalues" you won't see the answer you need, which is:
 
{
  "formValues": [
    {
      "FieldName": "YourHyperlinkColumnInternalName",
      "FieldValue":  " https://your-url.com, Your Description"
    }
  ]

}
 
I actually never found this answer until writing this blog! The way I figured it out was by looking at the version history of an item where the hyperlink changed, and noting how the previous value was constructed.
 

 â€‹â€‹â€‹â€‹â€‹â€‹â€‹

Comments