Forum Discussion

Filipe Matos's avatar
Filipe Matos
Copper Contributor
Apr 16, 2020
Solved

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

Hi,

According to this Microsoft article  https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/building-simple-cmdset-with-dialog-api 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

 

 

  • 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-command-set-to-specific-list-or-library.aspx

    I hope this helps.
    Thanks.

4 Replies

  • 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-command-set-to-specific-list-or-library.aspx

    I hope this helps.
    Thanks.
      • SeanyC67's avatar
        SeanyC67
        Copper Contributor

        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-list/ 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.

Resources