Questions tagged [pnpjs]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
87 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
702 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
119 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
2k 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
751 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
219 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
299 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
509 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
323 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
2k 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
223 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
344 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
491 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
560 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
125 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
216 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
55 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
520 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