Questions tagged [pnpjs]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
2answers
26 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
22 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
25 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
18 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
21 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
88 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
19 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
44 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']; ...
0
votes
0answers
23 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 ...
2
votes
1answer
34 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
2answers
378 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
184 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
20 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
31 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: ...
1
vote
0answers
27 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
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
0
votes
1answer
206 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 ...
0
votes
1answer
244 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
94 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
339 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
71 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
89 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
121 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
45 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
62 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
36 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
38 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
46 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 ...
0
votes
1answer
52 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
138 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
104 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 ...
1
vote
1answer
368 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
284 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
558 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
80 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
0answers
23 views

Issue while searching folder with specific name

I am facing an issue while retrieving the folder available in a list based on userId. Using the below code to fetch the folder using Name and the “response” returned is most the times “not available” ...
0
votes
1answer
236 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
49 views

SPFX open newform in modal

I'm new in SPFX and i'm trying to open a new form from a button. I'm testing IFrameDialog but it doesn't display it(https://sharepoint.github.io/sp-dev-fx-controls-react/controls/IFrameDialog/) I've ...
0
votes
0answers
95 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, ...
0
votes
0answers
23 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.
1
vote
1answer
199 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, ...
1
vote
1answer
1k views

How to get items from SP list using query and @pnp/sp and Filtering

I have a getItems function that accepts a filter, but I need to know how to pass in two different filters so that I can retrieve items filtered by both Age and First Name. Here is the definition of ...
0
votes
2answers
929 views

Show Uploading Percentage status in loader

I have a question about uploading file via PnP JS SPFx in SharePoint online. I had successfully uploaded files via PnP JS. After that, I need to show uploading percentage. Same requirement, using ...
0
votes
1answer
376 views

SPFX save array inside item response to display in render react

I am facing simple issue where I need to get value of an expanded person field in react. I am receiving the title and was able to assign it to a variable, but my need is to automatically get the value ...
0
votes
2answers
102 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 ...
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 ...
0
votes
0answers
416 views

Get Site Page URL (Modern Experience) - Pnpjs v1

I have a team site where the pages will be used to create a wiki for a company. In the image you can see the pages of the site created for the moment. I have added an MMS column for Managed Metadata ...
0
votes
1answer
343 views

SPFx - React - OfficeUI Fabric - Assign value from SharePoint List Item to DatePicker and DropDown Controls

Thank you for your reply. I have values stored in SharePoint list. Now I want to provide edit functionality to user so when user selects particular item, I’m showing user the fields in editable mode ...