Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [pnp-js-core]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
6
votes
1answer
1k views

How to perform CRUD Operations on sharepoint lists using React and PnP-JS Core with SharePoint FrameWork (SharePoint 2016)

I would like to create forms using react and PnP-JS Core with sharepointframework to perform CRUD Operations on sharepoint lists. Do you have any simple examples I can look at and test on SharePoint ...
5
votes
3answers
1k 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 ...
5
votes
2answers
3k views

SPFx - PnP-JS-Core - Check if list exist in current web

I want to check if list(by Display Name) exist in current web. In pnp developer guide is no information on how to work with lists? I need this for validate web property and i want to use pnp-core-...
4
votes
2answers
2k 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.
4
votes
1answer
90 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 '...
4
votes
1answer
679 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 ...
4
votes
1answer
1k views

SharePoint search refinements filters PnP-JS-Core 2.0.7

How can I add multiple refinements filters to Sharepoint search, using PnP-JS-Core 2.0.7 Thanks
4
votes
2answers
461 views

CSR jquery append not working on list items after async query

Hello i got some trouble displaying some icons inside a column using CSR, what it should do is to check for the contents inside a document set and if the content is equal to a content type and add a ...
4
votes
2answers
1k 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 ...
3
votes
2answers
3k views

How to make Pnp function async in spfx framework

I need to get data from a function as below. GetServiceListData():any { var resultData; pnp.sp.web.lists.getByTitle('Test').items.select('Title,FullName,DOJ,ManagerName/Title').expand('...
3
votes
1answer
1k views

PnP-JS-Core Property bags

Is there a way to get the property bags using PnP-JS-Core? There is nothing about it in the documentation or blogs that I've found in google. Using REST the call is: http://sitecollection/site/_api/...
3
votes
1answer
7k 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?
3
votes
2answers
247 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....
3
votes
2answers
553 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 ...
3
votes
2answers
3k 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/...
3
votes
2answers
271 views

PnP-js-core Document form

Is there any example or guide to start using PnP-JS-core in the forms? Sharepoint Online. I've been looking for a while without luck!
2
votes
1answer
409 views

SPFX - PnP JS Core for SPFx On-Premise v1.0.2

I want to use PnP JS Core in SPFx v1.0.2 React webpart for SP16 On-premise server . What is the version of pnp need to use and how to install it? What are the other options for accessing data in ...
2
votes
1answer
156 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
1answer
869 views

reference tenant site in config.json

I am working in deploying my first spfx webpart to production. I an testing it on my personal dev tenant first. I am hosting all my assets in a separate site collection called cdn (in both my ...
2
votes
1answer
321 views

Is it possible to set the decimals on a Number field?

I'm trying to update number fields to hold only 1 decimal place but I can't seem to do this through REST. I tried Pnp Js but it's not working, there's no error, it just doesn't update: pnp.sp.web....
2
votes
0answers
143 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
0answers
53 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 ...
2
votes
0answers
124 views

Dynamic update Icon in SPFX client Web Part

I am using office ui frabric details list to display documents on spfx client web part from here. Now, I want to implement check-in/check-out icons to be displayed on spfx client web part dynamically ...
2
votes
1answer
635 views

Update SharePoint Group Owner

I'm trying to update the Owner of a SP Group. This is what I've tried: import pnp from "pnp"; let newgroup = {}; pnp.sp.web.siteGroups.getByName("BA_Actuarial").get().then(function(g) { ...
1
vote
3answers
800 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 ...
1
vote
1answer
253 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
7k views

Sharepoint rest GetFileByServerRelativeUrl returns wrong results

So I have a document library at https://tenant.sharepoint.com/sites/Test/Documents/ and I have a document in it called Doc1.docx. It has an Item Id of 1. I use the following rest call in a browser ...
1
vote
1answer
179 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.
1
vote
1answer
383 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')....
1
vote
1answer
32 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>{...
1
vote
2answers
778 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
3answers
596 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
568 views

Trying to update Managed metadata column value in sharepoint library using pnp js

pnp.sp.web.lists.getByTitle("ListName").items.getById(1).update({ Title: Title, DeptDiv://internal name of list column { __metadata: { "type": "SP.Taxonomy....
1
vote
1answer
768 views

Working example with sp.profiles.clientPeoplePickerSearchUser from PnP @pnp/sp

I'm trying to take advantage of the people picker search helper in the PnP-JS-Core, but I get a JSON error in SP2013, 2016 and SharePoint Online. The error is the same everywhere. If I try to get data ...
1
vote
1answer
133 views

SPFx On-prem - How to lock thread when add new item with PnP-JS

I have list column where save unique department number and I want to lock thread when add new list item, because when two users click in the same time button save - department number is duplicated. ...
1
vote
1answer
1k views

Is it possible to Update SharePoint user field in Rest API with Email?

Is it possible to Save/Update User Field in SharePoint Rest API using email Addresses instead of USERID. Because in order to save 20 users i need to make 20 rest calls to get Userid is there any ...
1
vote
2answers
4k views

Sharepoint Online upload files to library with PnP-JS-Core 2.0.7

How do I upload a file with all properties or fields values to a sharepoint library? I'm using PnP-JS-Core 2.0.7 Thanks!
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 ...
1
vote
1answer
42 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@...
1
vote
3answers
76 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 '...
1
vote
0answers
40 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
227 views

Get documents thumbnail using pnp-js-core or rest api

How can I get documents thumbnail using pnp-js-core or rest api. I need to render a document card with its thumbnail. Thanks.
1
vote
1answer
453 views

Trying to access a list from another web application, but getting an error 401 (Unauthorized)

I'm a Sharepoint beginner, I'm trying to access a list which is in another site collection under another web application in the same farm. I'm working with pnp core js library. new pnp.Web("http://...
1
vote
1answer
191 views

Batch operation not following order

I've written a function using pnp-js-core to batch checkout, update and checkin selected items. Problem I'm seeing however is that it seems that by the time the first map is called the next one ...
0
votes
1answer
47 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
633 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
311 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....
0
votes
1answer
301 views

download file from document library by the help of item ID

How is it possible to download file from document library by the help of item ID? In my data I have only item ID of a file which was uploaded to document library now I want to download the file i.e ...
0
votes
1answer
287 views

Sharepoint Framework/PnP-JS/React : state Object doesnt work

I have created a property (age) in the state Object. However, I can not access this property in my code. I am getting an Error Message: Property 'age' does not exist on type '{} Here below is my ...
0
votes
1answer
294 views

PNP js API document update issue

I tried creating inserting a document in a document library using pnp js library. Problem comes in a specific case: A document is inserted in a library. Now this document is deleted and sent to ...