SharePoint Online:为多行文本字段设置默认值
要求:为 SharePoint Online 中的多行文本字段设置默认值。
如何设置多行文本字段的默认值?
多行文本字段不支持通过网页用户界面设置“默认”值。然而,这里有一个为多行文本列设置默认值的技巧。
- 在 SharePoint 设计器中打开 SharePoint Online 网站。
- 导航到您的目标列表单击“自定义”下的“编辑列表列”链接
双击列表的多行文本列。在“列编辑器”对话框中,您可以设置列的默认值!
PnP PowerShell 设置多行文本列的默认值:
要在 SharePoint Online 中设置多行文本字段的默认值,请使用以下 PowerShell:
#Parameters
$SiteURL = "https://crescent.sharepoint.com/sites/pmo"
$ListName = "Projects"
$ColumnName = "Project_x0020_Description" #Internal Name
$DefaultValue = "Project Code: <<Enter the Project code >>, Project description: <<provide a detailed project description>>"
#Connect to Tenant Admin
Connect-PnPOnline $SiteURL -Interactive
#Set Default Value for the field
Set-PnPField -Identity $ColumnName -List $ListName -Values @{DefaultValue=$DefaultValue}
