deploy spfx command set for doclib is not working

Contributor
 
Hi
    I have successfully deploy a spfx command set for custom list, which is RegistrationId=100, now i want to deploy it to document library, so i set it to 101 but doesn't working. The command set still deployed to custom list, it looks like this setting never take effect. Please help. Thanks Peter
 
<?xml version="1.0" encoding="utf-8"?>
<CustomAction
Title="HelloWorldCommandSet"
RegistrationId="101"
RegistrationType="List"
Location="ClientSideExtension.ListViewCommandSet"
ClientSideComponentId="422de19f-6007-474b-9d4d-b880595b0291"
ClientSideComponentProperties="{&quot;sampleTextOne&quot;:&quot;One item is selected in the list.&quot;, &quot;sampleTextTwo&quot;:&quot;This command is always visible.&quot;}">
</CustomAction>
</Elements>
1 Reply

@Peter Cheung i know this is a late response, but this is to help anyone else having this problem since this question is surfaced in search results

 

what you have to do is change the xml files in the spfx project found under sharepoint > assets

 

in ClientSideInstance.xml change ListTemplateId (and in elements.xml change RegistrationId) from 100 to 101, so to make it show up in custom lists you use 100, and you use 101 to make it show up in document libraries

 

if you need to use both at the same time, just copy and paste the xml chunks for ClientSideComponentInstance and CustomAction in their respective files

 

here is a link with a more thorough description plus pictures:

https://www.c-sharpcorner.com/article/sharepoint-framework-spfx-extension-add-list-view-command-set-...

 

hopefully this saves someone some time :)