People who code: we want your input. Take the Survey

Questions tagged [pnpjs]

The tag has no usage guidance.

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

Initialising spfxContext for a different user in pnp/sp

I'm trying to build an spFx app, that uses a different user to access lists and libraries than the logged in user. The logged in user won't have the permissions to access the lists directly but only ...
0
votes
0answers
16 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"; ...
1
vote
1answer
32 views

SharePoint how to ensure user in spfx

I have a question regarding SharePoint development. I'm working on a SPFX webpart for SP2019, the webpart is going to retrieve data from external source and the data will contain AD users. In my ...
0
votes
0answers
20 views

Get all the lists in a site and total items in each list using PnP JS in SPFX

I am planning to get all the lists in a site and the total items count in each list using PnP JS and display on a page in SPFX. Thanks
0
votes
1answer
51 views

Uploading Attachment and items in Sharepoint Library in SPFX

Here is the function to upload attachments and items in the SharePoint library through React-js in SPFX. Used PnP JS library for attachments uploading and items insertion in the SharePoint library. I ...
0
votes
2answers
3k 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 ...
1
vote
2answers
90 views

filter data for more than 5k items through pnpjs SPFx

Here is the situation : I have a list with 50k items. I have to get data from that list with a filter on status column (Status = true). So basically there are items with status true/false. When I ...
0
votes
1answer
41 views

Best practice to connect to pnp online in azure runbook

there are so many approaches, can anyone suggest which is best and secured way to do that?
2
votes
1answer
35 views

Can someone please explain what the block of code below is used for in SPFX

Can someone please explain what the block of code below is used for in SPFx? sp.setup({spfxContext: this.props.context});
0
votes
0answers
28 views

Get UPN or Azure AD User Id from SharePoint People or Group LookUp field

I'm using PnP JS to get the the values of a Person or Group field. Is there a way to retrieve the UPN or Azure AD User Id, using the SP Rest API? I have looked everywhere and I can't find an answer to ...
1
vote
0answers
31 views

PnP JS Search API - Get/filter all user created docs in a site collection

I would like to get all user created documents in the whole site collection using PnpJS Search. const results = await sp.search({ Querytext: ` contentclass: "STS_ListItem_DocumentLibrary&...
0
votes
1answer
137 views

Spfx with PnP.js / Graph: How to prevent redirect to spfxsinglesignon.aspx

We're developing an SPO custom web part, utilizing https://pnp.github.io/pnpjs for authentication and for communicating with SPO. I've noticed that when the page with our custom web part loads, the ...
0
votes
0answers
33 views

Iterate nested array of objects and append children to a particular object using jQuery/React

Iterate nested array of JSON objects and append children to a particular object using jQuery/React We are trying to create a tree view navigation using PnP react TreeView control for SharePoint ...
2
votes
2answers
60 views

Not able to insert data into TaskList In sharepoint Spfx

Using SP-Pnp-Js Library, I am not able to insert data from a webpart into the sharepoint Tasklist. private SubmitWorkflowForm(): void { var TaskNameVal = document.getElementById('taskName')['value']; ...
2
votes
1answer
37 views

Get page load time in modern SharePoint site

I need to run some JS script on each page in modern SharePoint online communication site so I created SPFx extension and added to the site. One of the things I need to do is to get page loading time (...
0
votes
0answers
25 views

Copy documents from document library A to document library B

I have a requirement to develop a solution based on SPFx, namely, copy main versions of a documents from document library A to document library B. I have tested copyto (PnP.js) but it only copies the ...
0
votes
2answers
716 views

Promise is missing properties

When I try to create array, to put the results in the array, then I get the following error message: const allItems : any [] = sp.web.lists.getByTitle("Documents").items.get(); Type '...
0
votes
2answers
30 views

When a document is deleted or published in a document library

I have a requirement to develop a solution based on SPFx, namely, when a document is deleted from a document library or a document is published (got main version) in a document library in SharePoint ...
1
vote
1answer
310 views

Filter based on date only, not time | PnP JS

I am using PnPjs to query a SharePoint list. I am using this code: let today: string = (new Date()).toISOString(); today = `${today.substring(0, today.indexOf('T'))}T00:00:00Z` let results = await sp....
0
votes
0answers
22 views

Microsoft Teams Tab is not able to fetch SharePoint List Data

Is there any way, so that my "Teams Tab" could fetch the value from SharePoint list's data? I have used SP PnP JS library in SharePoint SPFx to build this solution. I have Sync this ...
0
votes
0answers
42 views

Teams showing - Can't load the application on this page

I created a new application using SPFx in SharePoint online. I have sync the sppkg solution file to the Microsoft Teams. But when I am adding the application in the teams Tab its showing an error: ...
0
votes
0answers
10 views

Check if Group has a Role

I have a custom Role "My role" and a list. Is it possible, using PnPjs, check if a group of current user has the custom role "My role"? Thank you
1
vote
1answer
133 views

How to set thumbnail image and page description for sharepoint modern pages using pnpjs?

I'm trying to set thumbnail image and page description programmatically using pnpjs. By default it is picking banner image as thumbnail image and first paragraph in page as page description. How can i ...
0
votes
1answer
289 views

Creating items or updating items inside folder in sharepoint list in SPFX typescript using PNP or spghttp client

I was trying to creating an SPFX solution using React where on submit of form I am saving multiple items inside a folder in SharePoint list. I understood how to create folder inside SharePoint list ...
3
votes
3answers
3k views

SPFX and pnp/sp : How to get all sites

I am here today to ask you : how do you retrieve all sites on your tenant by using Pnp (formerly known as pnp-js) ? Or even using CSOM. I am trying to create a webpart where, in the PropertyPane, the ...
0
votes
1answer
381 views

Read excel file in spfx pnp js

I want to read an excel file which is stored in SharePoint library in PNP JS. How can I achieve this ?
0
votes
0answers
108 views

Typeerror : failed to fetch in pnpjs in Sharepoint SPFx webpart

I have written below code in SPFx Webpart to upload file to Sharepoint Library. It gives me error sometimes like TypeError : Failed to fetch. Can anyone give me some idea what this error signifies and ...
0
votes
1answer
524 views

Get and show image in SPFx webpart from a Image column in a SP List

I am currently building a SPFx webpart with React that will get items from a SharePoint list via PnP Js but when I'm trying get the image from the list I get stuck. Right now my SPFx webpart looks ...
0
votes
1answer
116 views

Pnp JS getting data from list

I am trying out pnpjs USING SharePoint framework and adding new item to my list. But when I try to gulp serve and run it inside my SharePoint Online const iar: IItemAddResult = await sp.web.lists....
0
votes
1answer
122 views

Property 'getFolderByServerRelativeUrl' does not exist on type 'IWeb'

I can not access getFolderByServerRelativeUrl() in pnp API. await sp.web.getFolderByServerRelativeUrl() Error: Property 'getFolderByServerRelativeUrl' does not exist on type 'IWeb'.
0
votes
2answers
170 views

How to get users job title using pnp-sp-js Sharepoint 2019 on-premise

I am working with SharePoint on-premise 2019 and I am trying to get job title from multiple users that are stored in a list as an object. I am using pnp-sp-js and React framework and can successfully ...
0
votes
0answers
18 views

Creating OOTB groups using SP pnp JS failed

I am using below script to create OOTB groups(member,visitor,owner) through SP PnP js in SharePoint Online. (async () => { const owner1 = "i:0#.f|membership|Username@<tenant>....
1
vote
2answers
56 views

Problem with connecting SPFX webpart to SharePoint via PnP Js

i am again sitting and want to experiment more with SPFX webparts and PnP Js but I am facing problems when I try to use PnP in my code connecting to SharePoint. I am facing the problem when I create a ...
0
votes
1answer
45 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}...
0
votes
1answer
94 views

Read Modified By column with pnpjs

I want to select the fields I call and get the Modified By field - what's the correct way to do this? sp.web.lists .getByTitle(myList) .items.select(['myId', 'Modified', 'Modified By']) ....
0
votes
1answer
59 views

sp-pnp-js gives error when building TypeScript project

I've been asked to make changes to a TypeScript project and compile it to get a new JavaScript file. The JavaScript file is just to be referenced from a SharePoint site, so there's no SPFx involved ...
0
votes
1answer
54 views

Cannot get related items with PnPjs search on workflow task content type

I am working on SPFx Project and using PnPjs search. My requirement is to search for pending workflow task for that I have created result source at site collection level. Builder query as below {...
0
votes
0answers
48 views

Sharepoint Spfx List View command set

I have a requirement to create a List view command set in SharePoint Online(no framework used) for a document set library. My document set has many folders based on year. So , basically I need to ...
3
votes
3answers
1k 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 ...
2
votes
3answers
2k 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
197 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....
1
vote
1answer
483 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
346 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
677 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
96 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
1answer
283 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
114 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, ...
2
votes
1answer
891 views

Set TaxonomyPicker with initial values from term store SPFx

I have created a command set for managing products that are saved in a SP list. Each product's categories are saved on a metadata column (terms ) on that list. If any user suddenly needs to edit an ...
1
vote
1answer
228 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
2answers
119 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 ...