Questions tagged [pnpjs]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
44 views

How to implement licensing model in Custom SharePoint Online Solution?

We are creating one small product in SharePoint using Pnp framework and REST API. We would like to implement licensing model in product for selling purpose. Anyone has experience with such kind of ...
0
votes
1answer
557 views

Dynamically Pass List item parameter using pnp js

I have created SPFx web part using React JS framework. I am reading the data from the CSV file and adding item to SharePoint list using inBatch in PnP JS. I was able to add the item to SharePoint ...
0
votes
1answer
160 views

How to retrieve Friendy URL from Term-Driven Page with SP PnP JS

With this piece of code, I get the properties of all terms of termset. I'd like to get the Friendly URL also. terms.get().then((terms:ITerm[])=>{ terms.forEach((term:any)=>{ ...
0
votes
1answer
840 views

SPFx web part does not show/load in SharePoint online “_layouts/15/workbench.aspx” page in the internet explorer browser

I have developed a SPFx web part for SharePoint online, while running the gulp serve command, this is loading in the local workbench (http://localhost:4321/temp/workbench.html), as we can see in the ...
1
vote
1answer
293 views

Method to get term URL in taxonomy in SharePoint TermStore using PnP JS library

Is there a method to get term URL in taxonomy in SharePoint TermStore using PnPJS library? I am using this code to retreive term Name, Parent and ID: export interface IPTerm { parent?: string; id:...
0
votes
1answer
1k views

Using PnP.js Create() and Update() function is not working but Read() and Delete() is working

Using the below SPFx PnP.js code I am doing the CRUD operation in SharePoint online list: private _getListData(): Promise<ISPList[]> { return pnp.sp.web.lists.getByTitle("EmployeeList").items....
1
vote
1answer
96 views

How get team site groupId property from a SPFX webpart with pnp/js

I create a webpart with SPFX and it is deployed in a team site. I need get the team site groupId property.
1
vote
2answers
43 views

How get values that return sp.site.createModernTeamSite in pnpjs

Using below function: const s = await sp.site.createModernTeamSite( CustomerName, CustomerID, true, 1033, "Customer Site for " + CustomerName); You can create a team Site, but ...
2
votes
2answers
424 views

REST API: How to get error details of Field Validation errors, SPListDataValidationException

I am using pnpjs to add items to a list like so: this.spClient.web.lists.getByTitle(this.spList).items.add(requestList); If requestList has items that do not pass column validation of the Sharepoint ...
0
votes
1answer
111 views

Load Terms - typescript error - spfx term store taxonomy

I am trying to retrieve all the terms for a term-set in my term store to be used in an SPFx web part. Following the guide given here. // get terms merged with data from a term set const terms4: (...
3
votes
1answer
130 views

ListItemChangesSinceToken doesn't page correctly?

I'm trying to page through getListItemChangesSinceToken to get an entire list and then any changes to it but I'm getting very inconsistent results. This is what I do to get the initial list of ...
1
vote
1answer
92 views

webparts using @pnp/js

I am trying to create a sharepoint page that contains a webpart which contains some text and images. I am trying to do this using pnp/js. I have been able to create a page using pnp/js, but I can not ...
1
vote
0answers
445 views

How to jump specific page using pnp js for sharepoint pagination

I am using pnp js Get Paged Items for pagination in my SPFx webpart. sp.web.lists.getByTitle("MyCustomList").items.top(10).getPaged(); Suppose I have 150 data in a list. I set 10 data for a page. So ...
0
votes
1answer
310 views

PNP JS Taxonomy Term retrieval not giving me back all terms in SharePoint online

I'm currently developing a WebPart for a client using SPFX, React JS and PNP JS where I need to get a full list of Countries from a Countries taxonomy at Tenant level to allow my to populate a ...
0
votes
1answer
36 views

Uncaught TypeError: Cannot read property 'txt' of undefined

I am new to PnP JS and I want to try it. Part my code: import pnp from "sp-pnp-js"; ... pnp.sp.web.select('Title').get() .then((data) => console.log(data)) But I got an error in console: ...
0
votes
1answer
177 views

pnp.js folder.moveTo() error: Microsoft.SharePoint.Client.ResourceNotFoundException

According to the pnp.js docs at: https://github.com/pnp/pnpjs/blob/dev/packages/sp/src/folders.ts there is a method called moveTo() which presumably moves a folder to a destination. However, the ...
3
votes
1answer
662 views

Sharepoint Item rest query How to get the multiline column value which has append text property set true

I have a multiline column named as "Notes" in a list. This column has the "append text" property set to true. So when I retrieve the item I am getting this column null value. Please help me query this....
2
votes
1answer
552 views

Query site collection property bag in SPFx extension

I am building an SPFx Application Customizer for a Powell365 project, and trying to have it use custom properties from the current site collections's property bag. I already managed to get these ...
0
votes
0answers
221 views

PnP JS Core : Uncaught (in promise): TypeError: Cannot read property of undefined

I am using PnP js in one of my angular 6 project. I have a function which is defined in the Component, but I am getting this error at run-time when calling from inside the success of PnP SP js: ...
2
votes
1answer
1k views

How to Get Site-users and Site-groups in SPFx using PnP-JS?

How to get the site users and site groups in SPFx using PnP JS? Thanks in advance.
0
votes
1answer
98 views

SharePoint Online Mega Menu

How can I create a Mega Menu using term-sets in SharePoint online? Any help would be appreciated. Thanks in advance.
0
votes
1answer
91 views

Get List Column configuration using pnp.js

I want to fetch the List column configuation to check if a field is required or not. But I am not able to figure out which function to use by looking at the documentation.
0
votes
0answers
79 views

Using PNP JS with SPFX 1.1

I am using SPFX 1.1 (because our SharePoint Environment is 2016) and tried to integrate PnP (Version 1.3.3). I followed the instructions from here to switch to typescript 2.4.2 instead of 2.2.2 https:...
1
vote
3answers
1k views

SharePoint Multiselect Choice field Saving using PnPjs

I want to save multi-select drop-down in SharePoint field. I already referred few results in this site. Choice values in SharePoint : Test1, Test2, Test3, Test4, Test5. From the custom drop-down ...
0
votes
1answer
179 views

SPFX: is @pnp/sp get call asynchronous?

I am new with @pnp/sp and I am having problems with my code: public render(): React.ReactElement<IVisualizadorPermisosProps> { var arbol=[]; sp.web.get().then((data)=>{ arbol....
0
votes
1answer
255 views

PnP js call returns “Item does not exist”

I'm running a small code to upload file in a SharePoint 2016 document library and to change a metadata. Sometimes (but really often) my code returns error "Error making HttpClient request in ...
0
votes
5answers
1k views

Adding SP user to member group - Team Site

I'm using the "Create a modern team site" using the PnP/PnPjs, and I want to add a user to the "Members" group of the newly created site. I tried using this code: let memberGroup = ...
1
vote
1answer
491 views

Programmatically creating folders in lists results in invisible or incorrectly named folders

So far I've found two ways to create a folder via pnpjs-wrapped API calls. One, which is SPList.rootFolder.folders.add("Name") works well for a document library, but, when used in a list, it results ...
1
vote
1answer
502 views

The query to field 'list/ChoiceField' is not valid."

I have a lookup list that contains a choice field. I'm trying to retrieve it's values using rest Expand= "list" Select= "list/ChoiceField" I get The query to field 'list/ChoiceField' is not ...
0
votes
1answer
100 views

Q: Set Folder's path according to it's title in a list with SPFx

I am creating a folder inside a List with the following code: TypeScript import {sp} from "@pnp/sp"; const shpList = sp.site.rootWeb.lists.getById(ListId); shpList.items.add( { Title: folderName, ...
1
vote
2answers
1k views

Q: Create list item inside folder with SPFx

I am trying to create an item within a folder in a list. Is there an approach with pnpjs that looks like the following? TypeScript import {sp} from "@pnp/sp"; const shpList = sp.site.rootWeb.lists....
0
votes
2answers
172 views

Q: Create visible folder in list with SPFx

Having the following code in an application extension: TypeScript import {sp} from "@pnp/sp"; /*******************************************************************/ const shpList = sp.site.rootWeb....
0
votes
2answers
3k views

Cant get List items when list item count gets over 5000

As the title says, I am using pnp js in a SharePoint online list: here is my code: let list = sp.web.lists.getByTitle("Resource Projection"); let query = `Quarter_x0020_Num eq ${currentQ} and ...
0
votes
1answer
1k views

Get another user info using PnPJS with SPFx

I want to get a list of items from a SharePoint list, and display them in a specific way in SPFx webpart. I could use PnPJS to get Text and Number fields, but for the Author field, I am only getting ...
0
votes
1answer
315 views

PNP.js is not working in Internet Explorer. Am not using SPFx. Custom SharePoint page

I am doing CRUD operation using pnp.js in SharePoint site through custom page. I am able to perform all the actions in EDGE and Chrome browser. But when I try to do the same in IE browser its not ...
0
votes
1answer
366 views

PNP.js adding a new SharePoint Group and setting the Group owner

I'm writing a webpart that creates several SharePoint Groups. I'm trying to set the Group Owner so it's not defaulting to the user creating the group. According to documentation, this should be ...
0
votes
1answer
634 views

How to get count of files Inside a subfolder- pnp-js?

I can get the count of files in a root folder using this pnp.sp.web.lists.getByTitle("Test").items.getAll().then((allItems) => { // how many did we get console.log(allItems.length); }); ...
0
votes
1answer
422 views

PNP-JS-How to check whether a folder is empty

I have gone through the questions in this forum and most of them address the Issue of how to check whether a folder exists in a Document Library. But, I would like to know how to check whether a ...
3
votes
3answers
3k views

SPFX and pnp/sp : How to get all sites

I am here today to ask you : how do you retrieve all sites on your tenant by using Pnp (formerly known as pnp-js) ? Or even using CSOM. I am trying to create a webpart where, in the PropertyPane, the ...
1
vote
1answer
304 views

How to test PNP using JEST?

Is there any way to mock the context of the webpart since i need it to be able to make a request through pnp ?
1
vote
1answer
384 views

Adding sections and web parts to the modern pages is not working

@pnp/sp version is 1.2.3/1.2.7 SharePoint version is SPO (online) I am loading the site in the Web object and adding the client side page using the web object. Once the page got created I am adding ...
2
votes
1answer
675 views

Get User's Time Zone using PnPJs

We are trying to retreive current user's profile Time Zone SPS-TimeZone from a SharePoint Framework webpart, but we are faicing an error (see below). Does anyone know about the best/most effecient way ...
2
votes
1answer
768 views

Set TaxonomyPicker with initial values from term store SPFx

I have created a command set for managing products that are saved in a SP list. Each product's categories are saved on a metadata column (terms ) on that list. If any user suddenly needs to edit an ...
2
votes
0answers
148 views

SPFX WebPart: Getting HTTPS certificate ERROR in IE11

Getting HTTPS certificate error in IE11, webpart is working fine in chrome, firefox, and Edge but NOT in IE11. The webpart is just displaying some simple list data in dropdown component, and nothing ...
1
vote
1answer
1k views

Get current folder within SharePoint document library with @pnp/sp

I need to get the folder name within a document library, within the ListCommand spfx extension. Is there a way to do that with REST ? can I use @pnp/sp ? I have imported the project with : import { ...
2
votes
0answers
242 views

PnP JS cross domain calls?

Does PnPJS have a way to make a cross domain call to a site collection? Trying to get data from another SharePoint site that I believe is on another web app and a different domain. This is SP2013
0
votes
0answers
64 views

REST call for fields: “Type cannot be null”

I'm making rest calls to get a lists fields in a custom JS application. For some reason it's failing when I make the call through the app but when I do it in the console it works fine. I'm using ...
1
vote
2answers
677 views

Ho do I update property bag items in SPFX extensions?

I want to update Property Bag items with pnp-core js. I can get the property bag items by the following code - pnp.sp.web.select('AllProperties').expand('AllProperties').get() But what is the code ...

1
2