Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [pnpjs]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

PnP JS - getShareLink is not working for PDF files

const result: IShareLinkResponse = await sp.web .getFolderByServerRelativePath(documentUrl) .getShareLink(sharingLinkKind); I am using this to generate shareable link with ...
Aaro Oral's user avatar
2 votes
1 answer
48 views

How do you initialize PnPjs when it's running in the context of a SharePoint site, but NOT in SPFx?

I'm buildng a React web part that's going to run on a SP2016 on-prem site. Usually when I do this kind of thing, I do all the data interactions using JavaScript's native fetch API. I've never had to ...
Dylan Cristy's user avatar
  • 12.7k
0 votes
0 answers
5 views

SharePoint content and term stores unique per site based on master

I have a problem to solve that I am stuck in analysis/choice paralysis for. Requirement: A "master" content type with around 60 and growing variations of the master that are site/customer ...
h00plah's user avatar
0 votes
1 answer
29 views

Update list items from a webpart hosted in another site collection not working with batch update (PnPjs)

I have recently faced this issue and took many hours of wandering around google to find the correct solution/reason for the issue. So I thought about adding it to stack exchange. Issue There was issue ...
Jefin Mathew's user avatar
0 votes
0 answers
38 views

Get a List of all Unique Values from Custom Text Field using REST Api or PNPJS

Hi i am stuck in a task i need to improve a SPFX WebPart. I need to create a autocomplete field that has a list of all possible values all-ready filled in in a Custom text field. The reason is we need ...
rread's user avatar
  • 11
0 votes
1 answer
45 views

Sharepoint Search REST API people SourceID gives 0 results

I implemented on my Sharepoint Online tenant Custom People Search Webpart using Sharepoint Search REST API (here to be precise pnp/js library). To find only people related hits, I used SourceId: ...
Krugerro's user avatar
0 votes
1 answer
50 views

How to get the last item of array after using split in pnp modern search results webpart v4

I am using PNP modern search v4 webparts, i was trying to modify the search results view, where i need to show the last item of array below is the sample code which is not working. {{#with (split (...
Alien 'D' mars's user avatar
0 votes
1 answer
50 views

Unable search and filter items based on Chinese & Japanese languages

I have a SharePoint list that contains fields as translations for the Title field in different languages. Some of them are Chinese Simplified, Chinese Traditional and Japanese. When I try to query the ...
Mohamed Derhalli's user avatar
0 votes
1 answer
30 views

REST: addUsingPath not supported in SharePoint 2016?

I run this in the browser: https://my.company.com/sites/news/_api/web/folders/addUsingPath(DecodedUrl='%2Fsites%2Fjnews%2Frufus%2Fholla',overwrite=false) and get: Cannot find resource for the request ...
Juergen Riemer's user avatar
0 votes
0 answers
36 views

Failed to set defaults using PnP js method SetDefaultColumnValues for a SharePoint library using SPFX webpart

I am developing a SPFX webpart which creates a SharePoint library, Add content type to the library, Delete Default Document content type and set default column values for the Managed Metadata columns ...
Kirthika Raja's user avatar
0 votes
0 answers
22 views

Why don't all users resolve before adding to a group as part of a batch?

I am trying to read the entries from a people-picker field in a list and add those user accounts to a SharePoint group. To avoid throttling, I am batching my requests. (getSP makes the call to spfi ...
Paul Rowe's user avatar
  • 168
0 votes
1 answer
22 views

Update a folder custom property after a searchresult

In my SharePoint site, I have my document library "MyDocs", and I have a list of companies "Companies" I added a new lookup column to the document Library "Company" to ...
serge's user avatar
  • 133
1 vote
0 answers
72 views

Connect pnp ListView to Sharepoint File and Media WebPart

I got a spfx webpart has a ListView of Files i get with a search in Sharepoint. Now i want that when i select a item in this listview it will Do the Preview of the file in a file and media component ...
rread's user avatar
  • 11
1 vote
2 answers
443 views

SharePoint online Image item URL does not get url in target Release for Everyone

I have tried to get image URL using rest Api and PnP js in my SPFx react solution but not get proper image URL from Api response. Below is the code and response from the Api. Missing serverRelativeUrl ...
Chandresh's user avatar
  • 509
0 votes
0 answers
18 views

Entering data into an excel sheet with PnPjs

I want to create a webpart for a sharepoint site, that allows users to enter an identifier about the sheet then using PnPjs i want to allow users to enter that data into the sheet. I would have ...
Carter Tomlenovich's user avatar
0 votes
0 answers
53 views

Waiting for folders to be created to avoid 'Not found' errors using PnPJS

I am using PnPJS to create folders in SharePoint within a SPFX WebPart. I'm having random issues when creating a bunch of folders when some of them return an error of 'Not Found'. For example: ...
Bentura's user avatar
  • 49
0 votes
1 answer
170 views

Pnpjs, How to surpress "Object is possibly 'undefined'" ts error on SharePoint context functions

For example I SP function, for example to format a date: const friendlyDate = new Date().format("dd.MM.yyyy"); console.log(friendlyDate); You can run in in Dev Tools on SharePoint page: ...
Gennady G's user avatar
  • 1,623
0 votes
1 answer
138 views

spfx pnpjs people picker error

I am getting an error when running my spfx webpart with a picker picker control. When I do gulp server I get the error ERROR: Cannot find module 'ControlStrings' I have googled this and have added ...
chris rowles's user avatar
0 votes
0 answers
166 views

Need a create list item example using spfx pnp

Having not touched spfx for sometime, I’m trying to find an example of creating a list item with a people picker a date picker and textfields but have not been able to find a working example. Can ...
chris rowles's user avatar
0 votes
1 answer
497 views

How to set a dropdown field in SPFx React.js to the placeholder value again after creating an item in an SP Online List?

I have a form with some values. Some of the fields in the form are dropdown fields. They get the dropdown values from SharePoint PNP/JS Rest Api call. Then the values from the form are used to create ...
Matthias's user avatar
0 votes
1 answer
200 views

filter a value from a list via PNP/JS and then store it in a locale variable within SPFx SharePoint Online

I have a lack of understanding of retrieving a value from a list. I want to use it to build a counter and then increment the counter locally after a button is pressed. After the incrementation I want ...
Matthias's user avatar
1 vote
1 answer
643 views

How can I get the profile photo of a user type field of a SharePoint list?

I am developing a Webpart with react and to get data from my Sharepoint I am using PnP js Objective: Get the profile photo of a user-type field of a Sharepoint list Problem description: I have a list ...
Jesus Eduardo Venegas Alfaro's user avatar
0 votes
0 answers
22 views

What is listener and subcriber in pnpjs/logging?

I'm a newbie to SPFx, I have a task to create a custom logger that can record any exception and error that happen in a web part (like serilog on .NET). I'm following a guide but there is something ...
supnep's user avatar
  • 1
1 vote
0 answers
144 views

Trouble using PnPJS for SharePoint Term Store in SPFx

I'm developing a SharePoint Framework (SPFx) application and am trying to interact with the SharePoint Term Store using the Patterns and Practices JavaScript Core Library (PnPJS). I'm using a version ...
Mohammed El Saka's user avatar
0 votes
0 answers
34 views

How to enable likes on a list with pnpjs or rest api?

I need to create a list programmatically from SPFX app. Creating the list is no problem, with pnpjs like so: sp.web.lists.add("Ideas","Ideas", 100, true); works great, but I need ...
Powell's user avatar
  • 23
0 votes
2 answers
160 views

Pnpjs how to set homepage of site?

Is there a way with pnpjs to set the homepage of a site? basically what Set-PnPHomePage commandlet does I can create a site, web, client side page, add controls to that page with pnpjs, but I cant see ...
Powell's user avatar
  • 23
0 votes
2 answers
608 views

Search in PnP Modern Search/site search not working unless explicity RefinableStrin100:myquery

I have a document library with two content types. One for the folders (document set) and one (document) for the documents itself. The document CT inherits from the other CT two columns and is these ...
Arte's user avatar
  • 167
0 votes
1 answer
297 views

CAML Sharepoint list to return email of Person Field

Goal: I have a Person column on a SharePoint list called Manager and I'd like to return the Manager Email for each list item as well as the value of a managed metadata field. I'm using the PnP JS ...
Jono Suave's user avatar
1 vote
1 answer
294 views

PnP JS Person field only returns FieldId and FieldStringId

I have a list with a few columns that are Person columns. Below is a snippet without a select nor expand: const newHires = this._sp.web.lists.getById(`${listId}`).items<ListItem[]>(); const ...
Jono Suave's user avatar
1 vote
1 answer
289 views

How to create a service scope using a sharepoint url passed in from an spfx property pane value

I'm using the service template found in the PnP JS documentation: export class SampleService { public static readonly serviceKey: ServiceKey<ISampleService> = ServiceKey.create<...
Jono Suave's user avatar
0 votes
2 answers
485 views

Unable to get PNPJS SPFX context from a ListView Extension

I am trying to create a list view extension, however I am unable to get the PNPJS context in order to query other lists. If I go to the URL that returns a 403 in a browser tab, it works. //default ...
Michael's user avatar
  • 179
0 votes
1 answer
66 views

Different technologies to interact with SharePoint and External systems inside our SPFx web part

I am developing 2 SPFx web parts. one which shows items from a SharePoint list and the other shows items assigned for the login user from SLACK. now for the technologies, to connect to the SharePoint ...
John John's user avatar
0 votes
1 answer
2k views

Property 'get' does not exist on type 'IFields'

In SPFx Webpart properties, as a cascading drop down showing all list/library from the current site, based on the selection of the list, trying to show the list fields. var spListColumns = _sp.web....
Arun's user avatar
  • 113
0 votes
1 answer
298 views

PnP Js - reading headers from request

I'm using PnPJs v3 for getting a data with REST API from SharePoint Online. Because there are many request, I'd like to implement a logic to avoid throttling. I can't figure out how to read (any) ...
mojimo's user avatar
  • 1
0 votes
1 answer
5k views

Unable to resole Module '"@pnp/sp"' has no exported member 'spfi'

I have an SPFX solution where I tried installing 'npm install @pnp/sp --save' Now, while using 'import { spfi } from "@pnp/sp"' I am getting below error. '"@pnp/sp"' has no ...
Kailash Sahoo's user avatar
3 votes
1 answer
1k views

Unable to resolve "@pnp/graph"' has no exported member named 'graph' in SPFX solution

I have an SPFX solution where I am trying to use Graph API. I tried installing 'npm install @pnp/logging @pnp/core @pnp/queryable @pnp/graph --save' Now, while using 'import { graph } from "@pnp/...
Kailash Sahoo's user avatar
1 vote
2 answers
191 views

How to build start token for list getchanges?

Using PnP JS for brevity. I am having major difficulty figuring out what date time format the following requires. Use case: I have date time for my last cache, I want to get the differences in my ...
Powell's user avatar
  • 23
0 votes
1 answer
408 views

pnp-js Unable to update file in subsite 403 error

I am trying to update a file in document library from webpart, code is working fine for site collection but not working for subsite, getting below error message Error: Error making HttpClient request ...
user4205's user avatar
  • 601
0 votes
0 answers
192 views

PNP/SP not working in team context

I have created the SPFX tab webpart with crud Operation in sharepoint list Not working in Microsoft teams app but this webpart working in sharepoint page because its getting SharePoint context I am ...
abhishek23 Negi's user avatar
1 vote
1 answer
847 views

ListViewCommandSetContext is not assignable to parameter of type ISPFXContext

I followed this tutorial : building-simple-cmdset-with-dialog-api And I installed the latest @pnp/sp (3.4.1) and according to the docs I should be able to use it as follows: const sp = spfi().using(...
Stef Heyenrath's user avatar
0 votes
1 answer
543 views

PNP js version 3 get sp object return a Proxy object

I create a SPFX with PNP JS version 3, when I try to get the sp object , it return a Proxy object. I try to use the getSP() function in the official demo , same result. getItems() { // const ...
testUser's user avatar
0 votes
1 answer
707 views

Get users who have permissions on a particular list item

Is it possible to check the list of users who have read access on a particular item using PnP JS? I tried something like this but roleAssignments is not available on item it seems. const response = ...
thinkdaniel's user avatar
2 votes
2 answers
2k views

Facing Error Implementing CRUD operations using spfi pnpjs package

I was trying to implement CRUD Operations using spfi. So, I was following this PnpJS Blog to find solution to my problem: https://pnp.github.io/pnpjs/sp/items/ So, they have imported spfi and assigned ...
Kshitij Gupta's user avatar
0 votes
0 answers
2k views

Undefined (reading 'web') error when using pnp/sp

I am trying to write a web part that gives the user a list of document libraries for the current site they are in, allows them to choose from this list, and then click a button which then gets all of ...
Bentura's user avatar
  • 49
1 vote
1 answer
267 views

Error while following Microsoft documentation on web part caching with PnPJS

Microsoft official documentation- https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/guidance/use-sp-pnp-js-with-spfx-web-parts In the PnPjsExample.tsx part, this part of code has: const ...
Kshitij Gupta's user avatar
1 vote
2 answers
1k views

Attempting to delete multiple items from SP list using pnpjs V3 but getting error on ```createBatch()```

I'm following this documentation: https://pnp.github.io/pnpjs/sp/items/#add-multiple-items But I'm getting an error with sp.web.createBatch(): import { SPFI, spfi, SPFx } from "@pnp/sp"; ...
Harminder Singh's user avatar
1 vote
1 answer
190 views

PnPJs Modern site webpart without SPFx - 404 error

Want to use PnPJs on a content editor webpart added to a modern page. All attempts to use pnp results in a 404. What is seen is that pnp is inserting /SitePages into the API call. https://{server}/...
DiveWoot's user avatar
0 votes
1 answer
725 views

What is the latest version of "sp-pnp-js" that is compatible with SPFx v1.4.1 (On-Premise)

Does anyone know which is the latest version of sp-pnp-js that is compatible with SharePoint Framework v1.4.1 for SharePoint 2019 On-Premise? Тhanks in advance
Goshky's user avatar
  • 2,058
0 votes
1 answer
323 views

how to dynamically populate image in propertyPane dropdownOptions?

check this image i want to get the same in DropdownOptions like this https://i.sstatic.net/ihfJn.png i'm getting key and title on the property pane perfectly i just need to display images from list ...
muhammad adnan's user avatar
0 votes
1 answer
945 views

RenderListDataAsStream Rest API not returning Field in ViewFields

RenderListDataAsStream is not returning some fields specified in ViewFields. I need to retrieve ServerRedirectedEmbedUrl but doesn't return anything. If I run the following CAML Query specifying the ...
C.P.'s user avatar
  • 1