I am trying to create a custom action in SharePoint, and get it appear in the context menu (the 3 dots next to the item in the list).
I have tried all different combinations of location in elements.xml
and ClientSideInstance.xml
, however I can only get it to show in the tool bar above.
this is my elements.xml
:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Title="HelloWorld"
RegistrationId="100"
RegistrationType="List"
Location="ClientSideExtension.ListViewCommandSet"
ClientSideComponentId="02d95d92-fde1-45a1-a428-941e8744d453"
ClientSideComponentProperties="{"sampleTextOne":"One item is selected in the list.", "sampleTextTwo":"This command is always visible."}">
</CustomAction>
</Elements>
According to this webpage: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/guidance/migrate-from-ecb-to-spfx-extensions
it says:
ClientSideExtension.ListViewCommandSet.ContextMenu: The context menu of the item(s).
ClientSideExtension.ListViewCommandSet.CommandBar: The top command set menu in a list or library.
ClientSideExtension.ListViewCommandSet: Both the context menu and the command bar (corresponds to SPUserCustomAction.Location="CommandUI.Ribbon").
but it doesn't seem to work.
The SharePoint site is a Communication site.