Questions tagged [pnp-js-core]

Formerly known as the Core Library for the Office Developer Patterns and Practices JavaScript Library. As of July 2018 this library was deprecated in favor of a new PnPJS library structure.

Filter by
Sorted by
Tagged with
0 votes
0 answers
21 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
  • 1
0 votes
0 answers
82 views

Using PnP JS: How Get users who have permissions on a particular list item

I am trying to get the user and their permissions for the particular item from SharePoint document library using PnP JS. PnP query: sp.web.lists.getByTitle("Documents").items.getById(211)....
ZMS's user avatar
  • 1
1 vote
1 answer
305 views

How to create several files with addUsingPath in a batch?

I'm trying to use pnp/js to create a batched web and add new files to a folder with addUsingPath with this code: const sp: SPFI = spfi().using(SPBrowser({ baseUrl: options.baseUrl })) const [...
Angelo Selvini's user avatar
0 votes
1 answer
37 views

Using https://github.com/pnp/pnpcore for a new project, is it s right appraoch, and what are the Microsoft alternatives for it

We want to start a new project now we are planning to develop it using those technologies:- Azure Functions This library https://github.com/pnp/pnpcore so is this a right approach to use this open ...
John John's user avatar
3 votes
1 answer
935 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
0 votes
1 answer
387 views

SharePoint content type based metadata column is not updating in Document library

I have created a site column that is a metadata type column. From that site column, I have created a content type that content type is assigned to the Document library. Now I have tried to update that ...
Santosh Rajput's user avatar
0 votes
0 answers
322 views

Couldnt get users from sharepoint group via pnp js selective imports

I am using code from documentation, basically the following to get all users from SharePoint group through selective imports. import { sp } from "@pnp/sp"; import "@pnp/sp/webs"; ...
Maddy's user avatar
  • 199
1 vote
1 answer
322 views

PnP SPFx PeoplePicker control works differently across site collections

I am new to SharePoint framework and in one of the requirement I need to use the pnp spfx PeoplePicker, I have a List which is in different site collection. i.e. my List resides in Site A and I have a ...
Asad_code's user avatar
1 vote
1 answer
148 views

PnP.Framewrok in an Windows App

Should it be possible to add PnP. Framework to Windows App? When I addd the nuget package I get following? Unable to resolve dependency 'PnP.Core'. Source(s) used: 'nuget.org', 'Microsoft Visual ...
Thomas Segato's user avatar
0 votes
1 answer
240 views

Create and Update Dictionary Key Value Pair using PNP js

I have a doubt in Key-value pair object. I need to create a key value pair and then I need to update it. Example: I have to create the following kind of object: var itemval = { Id:1{Name:aa,Idval:1}...
Nagarajan's user avatar
0 votes
1 answer
138 views

Move using spfx extension using getFileByID

i am trying below to move file from source to destination but always getting GUID as undefined if (event.selectedRows.length > 0) { // Check the selected rows event.selectedRows....
kumar's user avatar
  • 139
0 votes
1 answer
117 views

command set extension not visible in Ie11

Hi i created spfx command set extension but its not visible in IE11 other browser is visible and working. Used import "@pnp/polyfill-ie11"; as well but no luck , do i missing any ...
kumar's user avatar
  • 139
1 vote
1 answer
1k views

Show or hide SPFx extension based on user permissions

I like to show or hide extension as per user permission in SPFx ,suppose if user present in SP-group extension is visible or hide it @override public onListViewUpdated(event: ...
kumar's user avatar
  • 139
1 vote
1 answer
968 views

Show Loader in Spfx extension

I am working on requirement where i am moving document from Library 1 to Library 2 below goes the code , everything working fine but once i click it take some time to move document , i like to show ...
kumar's user avatar
  • 139
0 votes
2 answers
274 views

Spfx Extension Move document

Hi i am trying below code to move document from Documents library to SiteAssets library , but how to make it dynamic so selected document will be move to destination library @override public ...
kumar's user avatar
  • 139
0 votes
1 answer
200 views

PnP Provisioning templates in PnP Js

XML-based PnP Provisioning templates are available to be consumed via SharePoint PnP PowerShell. Question: Is there something similar for provisioning lists via JavaScript/TypeScript via pre-created ...
Denis Molodtsov's user avatar
0 votes
1 answer
67 views

anchor tag href redirects to another without clicking the icon

I have made 2 tabs , in the second tab I have a datatable in which one column holds the anchor element... In the anchor element I have "href" attribute in which I have called another ...
Nidhi Maheshwari's user avatar
0 votes
1 answer
1k views

How to Retrieve data from SharePoint list via PnP JS Core and CAML Query

As I am new to SharePoint framework, I am using PnP JS core library in SharePoint webpart,please suggest how can I retrieve list items from SharePoint list via PnP JS core and CAML Query. Please ...
Nidhi Maheshwari's user avatar
1 vote
2 answers
14k views

How to filter the retrieved items using a pnp-js-core REST call to a SharePoint list

As I am new to Sharepoint framework , I am trying to filter the retrieved list items from sharepoint list. Please find below code: pnp.sp.web.currentUser.get().then(function(res){ var userEmail = ...
Nidhi Maheshwari's user avatar
0 votes
1 answer
91 views

How to pad a number with leading zeroes using No javascript framework version in SPFx webpart?

As I am new to Sharepoint Framework, I am trying to generate request ID for the request form using the pad function for adding leading laeding zeroes using No javascript framework version in SPFx ...
Nidhi Maheshwari's user avatar
0 votes
1 answer
1k views

¨PnPJS Graph : how to list all members of a Group

I am trying to get all members from O365 group using pnpjs graph. Following is the snippet: import { graph } from "@pnp/graph"; import '@pnp/graph/groups'; const group = await graph.groups....
Maddy's user avatar
  • 199
1 vote
1 answer
1k views

How to use people picker control using sp-pnp-js( Pnp-JS-Core) library and save users selection in Person or Group type column in Sharepoint List?

As I am new to Sharepoint framework, I wan to know how can I use the people picker control using sp-pnp-js library and save the users selection in Person or Group type column in Sharepoint List.... I ...
Nidhi Maheshwari's user avatar
0 votes
1 answer
184 views

crud operation using bootstrap with pnp library

I was not able perform crud operation in bootstrap form using SP PnP JS library . Below is the code: public render(): void { let cssURL = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/...
Davy's user avatar
  • 31
1 vote
1 answer
980 views

You do not have permission to perform this action or access this resource PNPJS

We have an portal where an azure AD user will login and will be able to see the data from list on sharepoint. Trying to achieve this using PNPJS and Angular MSAL For the development phase,executed all ...
LearningPal's user avatar
0 votes
1 answer
1k 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 ...
Suhas Yerramsetty's user avatar
0 votes
1 answer
2k views

spfx pnp 404 when getting myProperties

I try to fetch my properties using the sp.profiles.myProperties.get() from @pnp/sp. It works on a hosted workbench but when I deployed the package and run it on Sharepoint site page I'm getting Error ...
Szybki's user avatar
  • 178
0 votes
1 answer
4k views

How to best implement pagination for a spfx web part displaying a list of links?

I have a web part that displays a filtered list of links based on the logged on users profile properties. Its working well, but I cannot work out the best way of adding pagination. The list is never ...
chris rowles's user avatar
0 votes
0 answers
399 views

Need to convert a sharepoint list field value from FieldValuesAsText to FieldValuesAsHtml in pnp-sp spfx webpart

I need lookupfield value,peoplepicker field value and enrich multiline text field value in one pnp-sp get call and display it in a table columnd so i used let item: [] = await siteweb.lists....
Bini Jacob's user avatar
3 votes
3 answers
6k 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 ...
mplwork's user avatar
  • 152
0 votes
1 answer
396 views

How to get lookup fields attachment in pnp js sharepoint online?

I would like to get lookup fields attachments url. For example Doctor Id EmployeeId(Look up) Attachments Employee Id EmployeeName Attachments (need to get) How can I get Employee list's ...
Nahid Hasan Kakon's user avatar
1 vote
0 answers
375 views

pnp.js - Join 2 sharepoint lists using camlquery

I am facing issue with joining 2 sharepoint lists using pnp.js. I have 2 lists, the first one named "Phasen" have 2 columns, Title, Wow. The second list named "Projects", have 2 cloumns - Title, ...
Amit Ghodke's user avatar
0 votes
1 answer
2k 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....
SP 2022's user avatar
  • 4,034
4 votes
4 answers
11k views

Property 'web' does not exist on type 'SPRest'

I installed these packages: @pnp/logging @pnp/common @pnp/odata @pnp/sp npm i @pnp/logging @pnp/common @pnp/odata @pnp/sp --save and tried this: import { sp } from '@pnp/sp'; public ...
bAbdenour's user avatar
  • 164
0 votes
1 answer
159 views

How can create a ListView Command with SPFx dynamically for several lists

I have created a listview Command for a specific list, "pageUrl": "https://contoso.sharepoint.com/sites/mySite/Lists/ListCommand/AllItems.aspx". It works fine, but is it possible to create it ...
Aris Vang's user avatar
0 votes
1 answer
7k views

How to get all files and other custom field from document library in pnpjs sharepoint online?

I have a document library named FileUpload. Another folder named FileInfoes inside the FileUpload. FileUpload(Document Library) -----FileInfoes(Folder) -----------Name -----------Label(custom ...
Nahid Hasan Kakon's user avatar
0 votes
1 answer
113 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: ...
akornev's user avatar
1 vote
1 answer
1k views

Email is not sending pnpjs in sharepoint online

I want to send mail to some users. But when i call send mail method, it shows no errors. but email not send.here is my code. public emailProps: EmailProperties = { To: ["abc@...
Nahid Hasan Kakon's user avatar
0 votes
0 answers
548 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: ...
Sandeep Nandey's user avatar
0 votes
1 answer
349 views

Not able to get the Category from calendar event

I am using a SPFx react web-part to get the events from calendar. I am expanding the calendar events however could not able to get the Category column. Here is the code I am using: public ...
Ramesh's user avatar
  • 574
0 votes
2 answers
249 views

How use result of pnp response

I use PnP for getting SharePoint list item. But I don't really know, how use the result of my function. I wish to get items of my SharePoint list using PnP and assign it to my list. My code don't ...
khadi's user avatar
  • 67
1 vote
3 answers
405 views

get sharepoint list with pnp [closed]

I want to get a sharepoint list and assign it to my list 'items' which of type is IExampleItem, but I don't really know how to do it; I tried the following code but it gives me an error, my list '...
khadi's user avatar
  • 67
2 votes
4 answers
5k 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 ...
Nagarajan's user avatar
1 vote
0 answers
143 views

Make multiple File Upload with their respective fields using PNP JS

I have a picture library with 4-5 fields - Lets Take - Title(string), Date(Date), FlagOn(Boolean). I am trying to upload 10 files to my picture library and for all these 10 files i want the same ...
Sukumar MS's user avatar
0 votes
2 answers
6k 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 ...
Dan Sto Domingo's user avatar
1 vote
1 answer
725 views

SharePoint framework unit testing pnp

How can I test with jest a pnp function? How can I mock the webpart context and pnp responses? I'm using spfx webpart, pnp-js-core and jest for unit testing Thanks.
Fabio Valencia's user avatar
0 votes
1 answer
395 views

SharePoint Online Search - Managed Property

How can I create a new managed property with an integer data type in the search schema in SharePOint Online? Thanks.
Fabio Valencia's user avatar
0 votes
1 answer
605 views

How to return string from sp pnp js request?

I need help with how I can return a string from a SP PnP js request? I want to display the string displayName in the console log on the last line. The result.Title is a string. public static ...
SaadRH's user avatar
  • 63
0 votes
1 answer
37 views

SharePoint Online Search

How could I filter by range in a managed property of type number in a sharepoint search? I'm using pnp-js-core Thanks so much.
Fabio Valencia's user avatar
1 vote
3 answers
9k views

Retrieving column fields from SharePoing list using sp-pnp-js

I have a list. I want to retrieve the fields to see how many column are there in my list. For example, my list name is TestList, I have created 5 columns of different datatypes. I want to retrieve ...
Shahidul Haque's user avatar
1 vote
2 answers
2k views

How to upload file in document library using pnp/sp

I have written code to upload the file in SharePoint online .. but while upload the page gets refreshed .. Please help . Code - sp.web .getFolderByServerRelativeUrl("Student%20Details%20No%...
BISWANATH HALDER's user avatar