Set Default Value for Hyperlink or Picture Column in SharePoint

Requirement: Set Default value for Hyperlink or Picture Column in SharePoint List

There is no provision for specifying default value in Hyperlink or Picture type columns in SharePoint! In some scenarios, we may want to specify SharePoint 2010/2013 hyperlink column default value. But there is no option in SharePoint web UI to enter hyperlink field default value!

set sharepoint hyperlink field default value

We can set the SharePoint hyperlink column default value with PowerShell! Use this PowerShell script to specify the default value for hyperlink or picture type fields:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Variables
$WebURL="https://intranet.crescent.com"
$ListName="Proposal Documents"
$ColumnName="Reference URL"
$DefaultValue="https://externalsites.crescent.com" 

#Get the Web
$web = Get-SPWeb $WebURL
 
#Get the List
$list = $web.Lists.TryGetList($ListName)
 
If($list -ne $null)
{
 #Get the column
 $column = $list.Fields[$ColumnName]

 if($column -ne $null)
 {
     #Set Default Value
     $column.DefaultValue = $DefaultValue
     $column.Update()
     $list.Update()
     Write-Host " Default value set for the column!" 
 }
 }
$web.Dispose() 

Here is the output for SharePoint list hyperlink default value specified programmatically:
 sharepoint 2013 hyperlink column default value

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

8 thoughts on “Set Default Value for Hyperlink or Picture Column in SharePoint

  • How do I update, the description

    Reply
      • Thanks. this description updated text under the display text. can we set the hyperlink default value link and display text not same?

        Reply
        • finally, i can set url and display text different value with below code. but it have the single or double quote with the string .

          Code:
          #Get the Web
          $web = Get-SPWeb $WebURL

          #Get the List
          $list = $web.Lists.TryGetList($ListName)

          If($list -ne $null)
          {
          #Get the column
          $LinkColumn =$list.Fields[$ColumnName]
          Write-Host $Link
          if($LinkColumn -ne $null)
          {
          #Set Default Value

          $LinkColumn.DefaultValue = {‘http://zzzz.com.hk/’, ‘Display text’}

          $LinkColumn.Update()
          $list.Update()
          Write-Host ” Default value set for the column!”
          }
          }
          $web.Dispose()

          Reply
  • How to set format url is Picture instead of Hyperlink using server side powershell?

    Reply
  • Hi Rajack,
    Where do you incorporate the PowerShell Script?

    Thanks,
    Linh

    Reply
    • Run the script in PowerShell ISE from any of your SharePoint On-Premises WFE!

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *