Set-PnPField

Tip

We encourage you to make improvements to this documentation. Please navigate to https://github.com/pnp/powershell/blob/dev/documentation/Set-PnPField.md to change this file.

Changes one or more properties of a field in a specific list or for the whole web

Syntax

Set-PnPField
   [-List <ListPipeBind>]
   [-Identity] <FieldPipeBind>
   -Values <Hashtable>
   [-UpdateExistingLists]
   [-Connection <PnPConnection>]
   [<CommonParameters>]

Examples

EXAMPLE 1

Set-PnPField -Identity AssignedTo -Values @{JSLink="customrendering.js";Group="My fields"}

Updates the AssignedTo field on the current web to use customrendering.js for the JSLink and sets the group name the field is categorized in to "My Fields". Lists that are already using the AssignedTo field will not be updated.

EXAMPLE 2

Set-PnPField -Identity AssignedTo -Values @{JSLink="customrendering.js";Group="My fields"} -UpdateExistingLists

Updates the AssignedTo field on the current web to use customrendering.js for the JSLink and sets the group name the field is categorized in to "My Fields". Lists that are already using the AssignedTo field will also be updated.

EXAMPLE 3

Set-PnPField -List "Tasks" -Identity "AssignedTo" -Values @{JSLink="customrendering.js"}

Updates the AssignedTo field on the Tasks list to use customrendering.js for the JSLink

Parameters

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type:PnPConnection
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Identity

The field object, internal field name (case sensitive) or field id to update

Type:FieldPipeBind
Position:0
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-List

The list object, name or id where to update the field. If omitted the field will be updated on the web.

Type:ListPipeBind
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-UpdateExistingLists

If provided, the field will be updated on existing lists that use it as well. If not provided or set to $false, existing lists using the field will remain unchanged but new lists will get the updated field.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Values

Hashtable of properties to update on the field. Use the syntax @{property1="value";property2="value"}.

Type:Hashtable
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False