5

When creating a FieldCustomizer extension as per the examples given, the process creates a new Site Column to which the customizer applies.

I want to create and deploy an extension that targets an existing column or site column in my SharePoint Online site.

2 Answers 2

7

This is possible by associating FieldCustomizer to existing field. Field object has ClientSideComponentId property, which should be updated to match the identifier of the FieldCustomizer manifest ID. You can perform needed update to existing field(s) by using CSOM/REST.

Same model also applies to ApplicationCustomizers, which are associated to UserCustomActions using ClientSideComponentId property. You can also update the ClientSideComponentProperties property with any instance level configurations, if needed.

If you use the tenant-wide deployment option, you will only need to have SPFx package installed on the app catalog and this would work. If you do not have tenant-wide deployment option enabled, you'd need to get the SPFx package installed to the site, before extension is loaded for the field.

1
  • Is there a sample to get the ClientSideComponentId using CSOM/REST? Commented Feb 27, 2018 at 12:02
3

As Vesa suggested, you can update the existing site column 'StockAvailable' property "ClientSideComponentId" by using pnp powershell.

Set-PnPField -Identity 'StockAvailable' -Values @{ClientSideComponentId=[GUID]"213b4c84-b9f6-49bd-ba46-c5a531825421"}

Here replace the above GUID by your SPFX field customizer Id found in manifest src/extension/customizername/**.manifest.JSON.

enter image description here

your already deployed spfx solution will render the field customizer. Below is the my case:

enter image description here

2
  • Looks good, but this works only after re-add site column. Do You know how to update existing (used) Site Column, which already contains data?..
    – Gennady G
    Commented Sep 4, 2019 at 14:57
  • 1
    Ok, found! There is another key -List that works for existing firlds (not site columns): Set-PnPField -Identity "MyPercetageField" -List "PercentagesList" -Values @{ClientSideComponentId=[GUID]"6a6cfa85-933b-4a3d-b08f-c2755bb2bae2"}
    – Gennady G
    Commented Sep 4, 2019 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.