Sp-dev-fx-webparts: Do we need any permission for the webpart(react-taxonomypicker) to access the term store

Created on 3 Jun 2020  路  6Comments  路  Source: pnp/sp-dev-fx-webparts

Thank you for reporting an issue, suggesting an enhancement, or asking a question. We appreciate your feedback - to help the team understand your
needs please complete the below template to ensure we have the details to help. Thanks!

Please check out the Docs to see if your question is already addressed there. This will help us ensure our documentation covers the most frequent questions.

Category

  • [ ] Enhancement
  • [ ] Bug
  • [x] Question
  • [ ] Documentation gap/issue

Version

Please specify what version of the library you are using: [ npm -v 6.14.4 ]

Please specify what version(s) of SharePoint you are targeting: [ SharePoint Online ]

Hello,

I downloaded the samples(sp-dev-fx-webparts-master) and I'm checking this sample: react-taxonomypicker, because I'm interested in use taxonomy picker for some react forms.

So I'm able to open the sample in VS code and I updated the term set id as below:

protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
return {
pages: [
{
header: {
description: strings.PropertyPaneDescription
},
groups: [
{
groupName: strings.BasicGroupName,
groupFields: [
PropertyPaneTaxonomyPicker("Language", {
key: "Language_Field",
name: "Language",
displayName: "Language",
multi: true,
termSetGuid: "1f016867-6b8b-4f95-8e47-f2c8ec7b2d00",

Then I was able to run the sample with below commands:

My question is: Do we need any permission for the webpart to access the term store?

Here a screenshot for my term store:
image

Thank you so much for your help!!!!

Needs help wanted question

Most helpful comment

Wow!!!!!! It's working!!!!!!!!!!!!!!

so thankfully with you guys!!!!!!

here my updated code with your code changes!!!

termsetNameOrID="4f5e7b8b-2a7d-4e93-a0f0-411de8c24e51"
anchorId="1f016867-6b8b-4f95-8e47-f2c8ec7b2d00"
panelTitle="Select City"
label="City"
//initialValues={this.state.selectedTerms}
context={this.props.context}
onChange={this._onTaxPickerChange}
isTermSetSelectable={false} />

All 6 comments

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

Hello,

I also tried with Taxonomy picker but still unable to access to terms.

Below taxonomy piker url and the code used on render method:

https://pnp.github.io/sp-dev-fx-controls-react/controls/TaxonomyPicker

<TaxonomyPicker allowMultipleSelections={false} termsetNameOrID="1f016867-6b8b-4f95-8e47-f2c8ec7b2d00" panelTitle="Select City" label="TaxonomyPicker" context={this.props.context} onChange={this._onTaxPickerChange} isTermSetSelectable={false} />

Thank you

Hi @RubenHerrera86,

Thank you for making a Screenshot of your TermStore with the TermSet I marked with A it works like expected. with your React code
image
at the control documentation page, I found the Property anchorId this can help you to get your expected result

<TaxonomyPicker allowMultipleSelections={false} 
              termsetNameOrID="c8952ad4-42c7-42eb-8ea7-43073b365fe5"
              anchorId="42f9b542-d3d4-476a-8b20-17ebaf263bc4"
              panelTitle="Select City"  label="TaxonomyPicker" context={this.props.context} 
              onChange={this.onTaxPickerChange.bind(this)}
              isTermSetSelectable={true} />

termsetNameOrID="c8952ad4-42c7-42eb-8ea7-43073b365fe5" Political Geography
anchorId="42f9b542-d3d4-476a-8b20-17ebaf263bc4" City

image

I hope this helps you

@RubenHerrera86 did @petkir 's suggestion help you solve your issue?

Wow!!!!!! It's working!!!!!!!!!!!!!!

so thankfully with you guys!!!!!!

here my updated code with your code changes!!!

termsetNameOrID="4f5e7b8b-2a7d-4e93-a0f0-411de8c24e51"
anchorId="1f016867-6b8b-4f95-8e47-f2c8ec7b2d00"
panelTitle="Select City"
label="City"
//initialValues={this.state.selectedTerms}
context={this.props.context}
onChange={this._onTaxPickerChange}
isTermSetSelectable={false} />

@RubenHerrera86 I'm glad you were able to resolve the issue!

Thanks @petkir for your help!

Was this page helpful?
0 / 5 - 0 ratings