Forum Discussion
SPFx webpart - Custom group name
Hi
I've created an SPFx webpart and I'm struggling to add it to a group with a new name. I believe it's the preconfiguredEntries where I configure this. I've read the documentation here:
https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/guidance/simplify-adding-web-parts-with-preconfigured-entries
I tried the following:
"preconfiguredEntries": [{ "groupId": "<generated a new GUID>", "group": { "default": "<new group name>" }, ...
The above did not work.
Could someone please provide and example of creating a custom group name for the webpart? Also, should I expect the group name to be displayed, or is it just used for grouping webparts? Finally, if the group name is displayed, would I see it in the workbench?
Thanks.
Alan Trafford, Yannick Borghmans, Lee Hoffner
Check out this YouTube video (starting time set to the correct moment) published some hours ago where you can confirm that this functionality is not yet available :)
Joel
13 Replies
- Marco BorziCopper ContributorHi if you want to know, for me worked:
"groupId": "5c03119e-3074-46fd-976b-c60198311f70",
"group": {
"default": "Hello Word!"
},
hope it help someone!- Alan TraffordBrass Contributor
Marco BorziThanks for the reply.
- Clint LechnerIron ContributorI'm kind of shocked we still can't add custom groups.
Alan Trafford, Yannick Borghmans, Lee Hoffner
Check out this YouTube video (starting time set to the correct moment) published some hours ago where you can confirm that this functionality is not yet available :)
Joel
- Alan TraffordBrass Contributor
Thanks for pointing me at the video. It's clear the functionality is not there yet.
Alan
- Yannick BorghmansCopper ContributorOw it is indeed not yet available. Thank you very much to look out for a solution and explanation.
Hi Alan Trafford,
Are you targeting modern or classic experience?
At the moment, the workbench does not group the web parts and all are listed under the "Featured" category/group I believe. A new web part picker may be coming soon to allow grouping.
Joel
- Alan TraffordBrass Contributor
- Yannick BorghmansCopper ContributorFor me it is in Modern, in Classic it indeed works like it should..
Do you got any reference for that quote of not yet working in modern?I'm following you know...just quickly tried it on Office 365 workbench and had the same issues. It's either a bug, functionality yet to be released in the future (maybe for the new web part picker?), or the usage should be simpler or better documented
I would recommend that you search the issues list on the following GitHub repo and add a new entry if you can't find the issue there:
https://github.com/SharePoint/sp-dev-docs
There is a large number of items there so don't be surprised if it takes some days to get an answer back.
- Yannick BorghmansCopper Contributor
Unfortunately, I have the same issue over here.
I already tried the following things:- removing groupID (=> error it is expecting the field/property)
- groupID:null (=> error since it required to have a value)
- groupID : "" (=> error since it seems to be internally parsed to a guid)
- new guid for groupID
All of the above with the group property:
"group": { "default": "<new group name>" },
The 'docs.microsoft.com'-documentation seems to be clear, but it simply doesn't work:
groupId string yes The group id determines which toolbox group will contain the web part. The SharePoint Framework reserves group ids for default groups. The developer can pick one of those groups. If a group id is specified, then the group property will be ignored. Alternatively, the developer can pick a completely unique id and a group name. The toolbox will then show the web part in its own group. "groupId": "6737645a-4443-4210-a70e-e5e2a219133a" group ILocalizedString no The name of the group in the toolbox in which the web part will be displayed. If no value is provided, then the web part will be displayed in the Custom group. "group": { "default": "Content", "nl-nl": "Inhoud" } So it's definitely good to bring this topic under attention.
- Lee HoffnerCopper Contributor
Seven days and no one cares to respond?
I have followed the same steps as the OP with the same result. If anyone knows the answer, please share.