SharePoint Online: How to Change Required Field Settings in a List or Library?

Requirement: Set required fields in SharePoint Online list or document library.

How to Set Required Fields in SharePoint Online?

Required fields setting in SharePoint Online lists and libraries help to ensure that users enter certain information when saving items or uploading files. You can configure any field as a required field in SharePoint – or change a field not to be required. By default, Certain fields are marked as “Required” in SharePoint. E.g., For custom lists – A title field is required.

You can mark a field as required either while creating a new column or editing an existing column in the SharePoint Online list or document library by settings the configuration “Require that this column contains information” to “Yes”.

sharepoint online document library required field

You can also change the required field configuration from list or library settings:

  1. Navigate to the list or library where you would like to mark a field as required.
  2. Click on the Settings gear icon in the top right of the page and select list settings.
  3. In the List Settings page, Scroll down to the Columns section and Click on a column that you would like to make required.
  4. Scroll down to the Additional Column Settings and to select “Yes” to make the field required or “No” to make it optional. sharepoint online required field
  5. Select OK to save your changes.

When users try to save an item or file without filling in the required field, they’ll see an error message “You can’t leave this blank”.

make a field required in sharepoint online

If the default value is set for any field, such as choice fields – The required field validation won’t trigger, as the default value will automatically apply. When you mark a field as required in SharePoint Online document libraries and bulk upload files either by Drag-and-drop/Explorer view/Menu, The documents will be checked out automatically and not available for other users until you populate the required fields and check-in them.

However, In modern libraries, this behavior is a bit different: Documents will not be checked-out (as long as the “Require Check Out” in the Versioning settings is set to “No”) when a mandatory field value is missing. Still, you’ll see a message “Required Info” on those items.

document library required field in sharepoint online

PowerShell to Change Required Fields Settings in SharePoint Online:

We can turn required field settings for all fields in a SharePoint List or library to either ON or OFF using PowerShell as:

#Set Parameters
$SiteURL = "https://crescent.sharepoint.com/sites/PMO"
$ListName = "Projects"

#Connect to SharePoint Online
Connect-PnPOnline -Url $SiteURL -Interactive

#Get the List
$List = Get-PnPList -Identity $ListName

#Get all Required Fields - Exclude system fields
$RequiredFields = Get-PnPField -List $List | Where { $_.Required -eq $true -and $_.Title -ne "Name" -and $_.ReadOnlyField -eq $false -and $_.Hidden -eq $false -and $_.InternalName -ne  "ContentType" -and $_.InternalName -ne "Attachments"}

ForEach($Field in $RequiredFields)
{
    #Set Required Field Flag to False
    $Field.Required = $False
    $Field.Update()
    Invoke-PnPQuery
    Write-Host "Required Field Settings updated for $($Field.Title)"
}

This script removes the required field flag from all columns and makes every field optional. You can set the flag as $True and change the where condition to do the reverse. Here is another post on using PowerShell to set a field as required or not-required: How to Make a Field Required in SharePoint Online using PowerShell?

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

One thought on “SharePoint Online: How to Change Required Field Settings in a List or Library?

  • This post gave me the direction I needed to delete the columns I mistakenly added. Thank you so much.

    Reply

Leave a Reply

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