Questions tagged [pnpjs]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
25 views

What is the use of WebPartContext in SPFx?

I am writing an SPFx, I have used React, PnP JS. I created a service class, which will be responsible to communicate with SharePoint. Below is the snippet of the code: export class service implements ...
0
votes
1answer
41 views

PnP REST API call to get Image URL (FileRef) Property

Started working on SPFx and would like to develop an Image Rotator. As a first step, I wanted to get all the images and respective properties using PnP JS and used the following call and got the ...
0
votes
1answer
33 views

How to check folder permissions using pnp/sp library in spfx web part?

I am developing one SPFx web part wherein I am showing all the folders which the logged-in user has access to. And I have a couple of folders in one document library(IT Docs) and some of the folders ...
0
votes
1answer
37 views

How do I fetch items from a specific view(s) of a Sharepoint list in SPFX?

I'm trying to fetch items from a specific view of a Sharepoint list in SPFX using @pnp/sp library but I'm unable to do so. I'm able to fetch the view properties and fields of the list. I didn't find ...
0
votes
0answers
23 views

Issue while searching folder with specific name

I am facing an issue while retrieving the folder available in a list based on userId. Using the below code to fetch the folder using Name and the “response” returned is most the times “not available” ...
0
votes
1answer
52 views

Move specific folder using PnPjs in a document library

I have add below PnP JS code but it's not working correctly and throwing error "Property 'moveByPath' does not exist on type 'Folder'". await web.getFolderByServerRelativePath(oldPath).moveByPath(`${...
0
votes
0answers
11 views

SPFX open newform in modal

I'm new in SPFX and i'm trying to open a new form from a button. I'm testing IFrameDialog but it doesn't display it(https://sharepoint.github.io/sp-dev-fx-controls-react/controls/IFrameDialog/) I've ...
0
votes
0answers
24 views

How to filter moderation status with pnp js?

I have a news portal, and I only want to show the approved news. It is possible, with pnp js in SharePoint 2019? I try filter with ModerationStatus, OData__ModerationStatus and _ModerationStatus name, ...
0
votes
0answers
11 views

Set properties of a spfx people web part dynamically using pnpjs

I've created a new modern SharePoint page using spfx pnpjs. Now I need to add a people web part to it with adding people to it dynamically through code. How can I achieve this? Thanks.
1
vote
1answer
41 views

Fetch multiple images from SharePoint library and display images in SPFX webpart

SharePoint Library -- Multiple image and HexID field I am able to display one image by giving full URL of images but i have to filter the images based on HexID, But I am not sure how to apply filter, ...
0
votes
0answers
50 views

How OverrideViewXml parameter works with ViewXml in RenderListDataAsStream in rest API?

I am working on to get data from SharePoint list using the RenderListDataAsStream endpoint. What I am doing is first getting all the views defined for the list and showing them in a dropdown on UI and ...
1
vote
1answer
114 views

How to get items from SP list using query and @pnp/sp and Filtering

I have a getItems function that accepts a filter, but I need to know how to pass in two different filters so that I can retrieve items filtered by both Age and First Name. Here is the definition of ...
0
votes
2answers
185 views

Show Uploading Percentage status in loader

I have a question about uploading file via PnP JS SPFx in SharePoint online. I had successfully uploaded files via PnP JS. After that, I need to show uploading percentage. Same requirement, using ...
0
votes
1answer
114 views

SPFX save array inside item response to display in render react

I am facing simple issue where I need to get value of an expanded person field in react. I am receiving the title and was able to assign it to a variable, but my need is to automatically get the value ...
0
votes
2answers
47 views

Get multiple lists Items via REST API

I am trying to get weather (wx) info from Region Weather list and and wxicon from another list. For List from Region Weather I can get it, For List from wxicon I could not get it. I attempted to use ...
3
votes
3answers
354 views

REST API: How to get the n most recent items in ascending order

This seems like a very basic question but I can't figure it out. Using pnpjs I want to retrieve the 50 most recently created items, oldest first, newest last. I can only manage to get them in the ...
0
votes
0answers
203 views

Get Site Page URL (Modern Experience) - Pnpjs v1

I have a team site where the pages will be used to create a wiki for a company. In the image you can see the pages of the site created for the moment. I have added an MMS column for Managed Metadata ...
0
votes
1answer
127 views

SPFx - React - OfficeUI Fabric - Assign value from SharePoint List Item to DatePicker and DropDown Controls

Thank you for your reply. I have values stored in SharePoint list. Now I want to provide edit functionality to user so when user selects particular item, I’m showing user the fields in editable mode ...
1
vote
1answer
206 views

Handle failure response on SharePoint list item add using PnP JS

I have created one SPFx web part with React framework to add the items from .CSV file to SharePoint list using PnP JS. I have used PnP JS item.add() method to add the item in the list by looping each ...
0
votes
1answer
33 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
269 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
86 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
317 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
167 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
445 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
55 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
35 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
178 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
69 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
79 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
53 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
280 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
185 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
0answers
132 views

REST API: How to get field names in different language

I am using the REST API via pnpjs and nodejs to access Sharepoint online. I'd like to get field descriptions and titles in a language which is different from the user's current settings. How could I ...
0
votes
1answer
32 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
110 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
306 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
286 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
116 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
889 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
59 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
57 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
60 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
2answers
757 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
120 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
170 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
869 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
335 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
317 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
85 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, ...