SOLVED

SPFx webpart - Custom group name

Brass Contributor

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-wi...

 

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.

13 Replies

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.

 

 

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:

 

groupIdstringyesThe 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"
groupILocalizedStringnoThe 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.

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

For 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?

Hi @Yannick Borghmans,

 

When you open the web part picker on a modern page, do you see out-of-the-box web parts grouped into different groups?

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.

best response confirmed by Alan Trafford (Brass Contributor)
Solution

@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

Ow it is indeed not yet available. Thank you very much to look out for a solution and explanation.

Hi @Joel Rodrigues

 

I'm targeting the modern experience.

 

Alan

Hi @Joel Rodrigues

 

Thanks for pointing me at the video. It's clear the functionality is not there yet.

 

Alan

Hi if you want to know, for me worked:
"groupId": "5c03119e-3074-46fd-976b-c60198311f70",
"group": {
"default": "Hello Word!"
},

hope it help someone!

@Marco BorziThanks for the reply.

I'm kind of shocked we still can't add custom groups.
1 best response

Accepted Solutions
best response confirmed by Alan Trafford (Brass Contributor)
Solution

@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

View solution in original post