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
1answer
2k views
4
votes
2answers
2k views

Asynchrounously load lookup column values in an SPFX/PNP-JS-CORE editform

I'm working on a spfx app to be used as a SharePoint list form. The app will be used to edit ha a LOT of lookup columns. the lookup columns are rendered as dropdowns in the react component. I am ...
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
68 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 ...
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.
0
votes
1answer
37 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 ...
3
votes
3answers
875 views

Frequent sites on SharePoint Online Home Page

Is there a way I can have "Frequent sites" on my website? Is this a webpart or SpFx component that I can add to any of my existing site? I would like below into my own site page. Digging bit more I ...
0
votes
0answers
210 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 ...
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 ...
3
votes
1answer
9k views

SPFx - How to get current user properties with PnP-JS-Core [duplicate]

I want to get current user login name with PnP-Core-Library for SPFx in Office365. My page is modern Page аnd I can not use it _spContextPageInfo How to do this?
0
votes
0answers
34 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....
3
votes
3answers
351 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
33 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 ...
1
vote
0answers
72 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, ...
2
votes
3answers
3k 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 ...
0
votes
1answer
440 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....
0
votes
1answer
33 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 ...
0
votes
1answer
853 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 ...
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: ...
1
vote
1answer
252 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@...
0
votes
0answers
114 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: ...
1
vote
3answers
222 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 '...
0
votes
1answer
34 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 ...
1
vote
2answers
745 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
0answers
65 views

Requesting files in paged order of name from SharePoint Library using pnp js

I am currently developing a web part that displays files in a document library in a table ordered by File name, If this were a standard list I could use pnp js to OrderBy 'Title' but as the 'Title' ...
3
votes
2answers
5k views

pnp.sp.site.getWebUrlFromPageUrl method is returning wrong web URL

I am using sp-pnp-js for my spfx project. GetWebUrlFromPageUrl method is returning wrong URL that includes sitePages also. Please refer: my current page location is https://xxxx.sharepoint.com/sites/...
5
votes
3answers
2k views

PnPJS with on-prem sharepoint?

Is it possible to use https://github.com/pnp/pnpjs with on-premise SharePoint with an external NodeJS application? Installing web parts is not an option I must perform read-only access. If so, what ...
1
vote
0answers
80 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 ...
1
vote
1answer
299 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.
0
votes
1answer
91 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.
0
votes
1answer
299 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 ...
0
votes
1answer
32 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.
1
vote
3answers
3k 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 ...
4
votes
2answers
3k views

Insert multiple users and groups in a user field of a Sharepoint Online list using Pnp-Js-Core

How can I insert multiple users and groups in a user field of a Sharepoint Online list using Pnp-Js-Core? greetings and thanks.
1
vote
1answer
544 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%...
1
vote
1answer
1k views

How to expand person lookup field?

How do I select all the fields and expand a person lookup field using the pnp js library? $pnp.sp.crossDomainWeb(addinweb, hostweb).lists.getByTitle("Sites").items.select('*').expand('Person Field')....
0
votes
1answer
665 views

Error while creating list item with multi-user field - pnp js / spfx

In my spfx webpart, I'm creating list item using pnp js. As per pnp-core-js documentation I have written following code, but its failing with error. Private AddListItem() { pnp.sp.web.lists....
1
vote
1answer
34 views

Getting always extra button on display .. 1 button dont have any ID

I am having problem while looping. I am always getting an extra button. Please help. {this.state.items.map(myitems1 => { return ( <div key={myitems1.Id}> <span>{...
0
votes
1answer
52 views

Sharepoint PnP & SPFX React [duplicate]

While binding the data always getting extra row ... {this.state.items.map(myitems1 => { return ( <div key={myitems1.Id}> <span>{myitems1....
4
votes
1answer
214 views

Unable to pull in Number/Lookup Columns using pnp.js

I'm pulling in data from a SharePoint list and I'm having some issues pulling in certain columns. I was able to successfully pull in the 'Title' column which is a single line of text, but 'Rank' and '...
2
votes
0answers
209 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
2
votes
1answer
201 views

Rest API to update a library item giving 400 error

The code am using: pnp.sp.web.getFolderByServerRelativeUrl("Shared%20Documents").files.getByName("test.jpg").getItem().then(item => { item.update({ Title: "A Title", ...
2
votes
0answers
84 views

I need to get all properties of taxonomy termstrore. which I already get are “Label”,“WSSId”,“TermGuid” but I need to get Other labels as well

Is there any solution to get other properties for taxonomy termstore. As I remember, I usually used "include" to get all properties which I mentioned in JSOM. But now I need to work by using ...
1
vote
3answers
1k views

Promise Is Undefined for PnP Js core SharePoint - IE & Edge Browser

I am a beginner using PnP js core Library. I am using PnP Js core library in my SharePoint web part to Display list Items from SharePoint list. The code works fine in Chrome and Firefox browsers. ...
1
vote
1answer
1k views

Show loading indicator for any ajax operation via SP PnP JS

We are developing a SPFx webpart and are using SP Pnp JS to fetch and update list items. Previously we used AngularJS where we write a directive to capture any $http events and show a loading ...
0
votes
1answer
153 views

SharePoint Content Editor not displaying PnPJS Code

I want to be able to display my PnPJS code and make it show up within the Content Editor, but I am having trouble pulling the data in and displaying it. Here is what I have so far: 1.) I made a ...
4
votes
1answer
1k views

Can't get context for pnp get api calls in spfx solution

I'm having trouble getting the correct site context for @pnp/sp. It works fine in workbench but not when I deploy to a site and add to a modern page. My api calls are being made to /_api/sitepages and ...
5
votes
2answers
386 views

Batch operations in SharePoint 2013

Unfortunately, I am stuck in a SP 2013 world now. I know batch operations (using REST APIs) are only supported in SharePoint 2016+ and in SPO. Pnp Js also has a good batch processing extension methods....
1
vote
2answers
1k views

Deleting sharepoint list items with pnp results in bad request

Running pnp in modern script editor spfx web part, can add items, get items from a list, but cannot delete items from a list: $pnp.sp.web.lists.getByTitle('List Name').items .filter('Title eq ...
1
vote
1answer
2k views

How to update a metadata list field using PnP

I'm trying to update a list item field that is Managed metadata field using PnP-JS-Core. First I was getting this error: pnp.min.js:10 Uncaught (in promise) TypeError: Converting circular structure ...