Questions tagged [pnpjs]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
26 views

Get SharePoint URL using sp-pnp-js in SPFx

I have a SharePoint SPFx react webapp that I'm working on. I'm trying to get the SharePoint URL. For example: https://mysite.sharepoint.com/sites/sitename/SitePages/Home.aspx#/ So I want to get ...
0
votes
0answers
23 views

Unable to receive email sent to multiple users using SPutility.sendemail having inline images in email body

I am unable to receive email having inline images sent to multiple recipient using sputility.sendemail PnP js. But I am able to send email having inline images to single user.
0
votes
1answer
14 views

Metainformation about SharePoint structures for typescript/JavaScript?

Hi all I think it is easier if I try to explain with an example. So if I want to add a field using xml I need to populate the xml based on what data a field of an specific type can have. SharePoint ...
0
votes
0answers
19 views

Chrome Extension and PnP JS

I am building a chrome extension for SPO. It has multiple html pages and I need to make PnP JS(SP Rest API) calls. I am using react app. I was able to read the cookies FedAuth and rtFa from content ...
0
votes
0answers
9 views

you may need an appropriate loader to handle this file type

I am using the following code from pnp js library with modifications but it wont build. import { MsalFetchClient } from "@pnp/nodejs"; import { sp } from "@pnp/sp"; import &...
0
votes
0answers
9 views

How to mention a user in Outlook email body using SPFx PnPjs ,so that it shows what exactly should show if someone mention in Outlook email

How to mention a user in Outlook email body ? I am using SPFx so in PnPJs or MSGraph any solution will be fine. Just want to use exactly the same functionality that Outlook offers when we mention ...
0
votes
0answers
64 views

How RenderListDataAsStream works internally to get the result set

For one of the list I have more than 100K records and I need to display the data based on certain filter conditions using SPFx WebPart. I am using RenderListDataAsStream endpoint which works ...
1
vote
0answers
49 views

SitePicker PnP control not returning any value in my one of the tenant

PropertyFieldSitePicker Pnp control not returning any value in my one of the tenant but in another tenant, it's working fine. Scenario: I have created one SPFx solution with PropertyFieldSitePicker ...
0
votes
1answer
33 views

How to get Library Name using sp.web.getFileByUrl

Is there any way to get the library name in the SP.web.getFileByUrl. I have tried the below code but not getting library name let result = await sp.web.getFileByUrl("https://sample.sharepoint.com/...
0
votes
0answers
28 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
129 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
30 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
336 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 ...
1
vote
2answers
324 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
134 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
67 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
53 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
52 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
232 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
74 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
104 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
30 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
86 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
2k 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
32 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
659 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
24 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
75 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
1answer
86 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
11 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
478 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
617 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
145 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
989 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
207 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
198 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
269 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
19 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
89 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
158 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
61 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
83 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
1answer
90 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
375 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
183 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
722 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
485 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
949 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
157 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
422 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(`${...