Field Customizer extension for list column

%3CLINGO-SUB%20id%3D%22lingo-sub-165771%22%20slang%3D%22en-US%22%3EField%20Customizer%20extension%20for%20list%20column%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-165771%22%20slang%3D%22en-US%22%3E%3CP%3EDear%20friends%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20have%20created%20a%20field%20customizer%20but%20it%20needs%20to%20have%20a%20site%20column%20as%20per%20the%20documentations.%20I%20have%20got%20to%20apply%20to%20an%20existing%20list%20column%2C%20is%20there%20a%20way%20to%20do%20that%3F%20Please%20help.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20in%20advance.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-168033%22%20slang%3D%22en-US%22%3ERe%3A%20Field%20Customizer%20extension%20for%20list%20column%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-168033%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20can%20associate%20FieldCustomizer%20to%20existing%20list%20field%20by%26nbsp%3Bsetting%20'ClientSideComponentId'%20property%20of%20target%20list%20field%20with%20value%20of%20FieldCustomizer%20Id.%20You%20can%20do%20that%20either%20CSOM%2FREST%20or%20PowerShell.%20Below%20is%20sample%20code%20using%20PnP%20PowerShell.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EConnect-PnPOnline%20-Url%20'%3CSITEURL%3E'%20-Credentials%20(Get-Credential)%3CBR%20%2F%3E%24targetList%20%3D%20Get-PnPList%20-Identity%20%22%3CLIST%20title%3D%22%22%3E%22%3CBR%20%2F%3E%24targetField%20%3D%20Get-PnPField%20-List%20%24targetList%20-Identity%20%22%3CFIELD%20internal%3D%22%22%20name%3D%22%22%3E%22%3CBR%20%2F%3E%24targetField.ClientSideComponentId%20%3D%20%22%3CFIELDCUSTOMIZER%20id%3D%22%22%3E%22%3CBR%20%2F%3E%24targetField.ClientSideComponentProperties%20%3D%20%22%3CFIELDCUSTOMIZER%20properties%3D%22%22%3E%22%3CBR%20%2F%3E%24targetField.Update()%3CBR%20%2F%3EExecute-PnPQuery%3C%2FFIELDCUSTOMIZER%3E%3C%2FFIELDCUSTOMIZER%3E%3C%2FFIELD%3E%3C%2FLIST%3E%3C%2FSITEURL%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Dear friends,

 

I have created a field customizer but it needs to have a site column as per the documentations. I have got to apply to an existing list column, is there a way to do that? Please help.

 

Thanks in advance.

1 Reply
Highlighted

You can associate FieldCustomizer to existing list field by setting 'ClientSideComponentId' property of target list field with value of FieldCustomizer Id. You can do that either CSOM/REST or PowerShell. Below is sample code using PnP PowerShell.

 

Connect-PnPOnline -Url '<SiteURL>' -Credentials (Get-Credential)
$targetList = Get-PnPList -Identity "<List Title>"
$targetField = Get-PnPField -List $targetList -Identity "<Field Internal Name>"
$targetField.ClientSideComponentId = "<FieldCustomizer ID>"
$targetField.ClientSideComponentProperties = "<FieldCustomizer properties>"
$targetField.Update()
Execute-PnPQuery