SOLVED

Limit the display of a command set to a specific list instance

Occasional Contributor

Hi,

According to this Microsoft article  https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/building-simple-cmdset-w... on how to create command set extension, one can publish a command to one or more generic type of lists / document libraries by setting them in the file elements,xml.

For instance, making all custom lists display the command set:

 

RegistrationId="100"
RegistrationType="List"

 

 

However, I want a command set to appear in only one specific list instance rather than in all custom lists / document libraries.

 

Do you know, how can this be done?

 

Thank you

Filipe

 

 

4 Replies
best response confirmed by Filipe Matos (Occasional Contributor)
Solution
Hi,
Yes, you can apply list view command set to a specific list/library.
Please refer this link which will be helpful -
https://social.technet.microsoft.com/wiki/contents/articles/52807.spfx-extension-apply-list-view-com...

I hope this helps.
Thanks.

Hi @Swaminathan Sriram,

Sorry for the late feedback. Your answer did help.

Thank you

Filipe

Hi @Filipe Matos - I think hardcoding the listname is not a great solution. Have a look here :-

https://www.c-sharpcorner.com/article/enabling-an-spfx-listview-command-set-on-a-specific-sharepoint... where the dev uses the site property bag to enumerate the lists guids which will have the functionality.

Would be good if SpFx natively had more scoping options.

Hi @SeanyC67

Thank you for pointing this out, I will have a look at it.