Questions tagged [pnpjs]
The pnpjs tag has no usage guidance.
113
questions
0
votes
0
answers
30
views
Facing Error Implementing CRUD operations using spfi pnpjs package
I was trying to implement CRUD Operations using spfi,
So, I was following this PnpJS Blog to find solution to my problem - https://pnp.github.io/pnpjs/sp/items/
So, they have imported spfi and ...
0
votes
0
answers
32
views
How to give external users the ability to view internal user profile pictures
We're using SharePoint Online as a portal for our clients and would like the client's to be able to see the Office 365/Outlook profile pictures of our employees. I'm using PnPjs to retrieve the photo ...
0
votes
0
answers
33
views
Undefined (reading 'web') error when using pnp/sp
I am trying to write a web part that gives the user a list of document libraries for the current site they are in, allows them to choose from this list, and then click a button which then gets all of ...
1
vote
1
answer
34
views
Error while following Microsoft documentation on web part caching with PnPJS
Microsoft official documentation-
https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/guidance/use-sp-pnp-js-with-spfx-web-parts
In the PnPjsExample.tsx part, this part of code has:
const ...
1
vote
1
answer
57
views
Attempting to delete multiple items from SP list using pnpjs V3 but getting error on ```createBatch()```
I'm following this documentation: https://pnp.github.io/pnpjs/sp/items/#add-multiple-items But I'm getting an error with sp.web.createBatch():
import { SPFI, spfi, SPFx } from "@pnp/sp";
...
1
vote
1
answer
15
views
PnPJs Modern site webpart without SPFx - 404 error
Want to use PnPJs on a content editor webpart added to a modern page. All attempts to use pnp results in a 404. What is seen is that pnp is inserting /SitePages into the API call.
https://{server}/...
0
votes
1
answer
76
views
What is the latest version of "sp-pnp-js" that is compatible with SPFx v1.4.1 (On-Premise)
Does anyone know which is the latest version of sp-pnp-js that is compatible with SharePoint Framework v1.4.1 for SharePoint 2019 On-Premise?
Тhanks in advance
0
votes
1
answer
31
views
how to dynamically populate image in propertyPane dropdownOptions?
check this image i want to get the same in DropdownOptions like this
https://i.stack.imgur.com/ihfJn.png
i'm getting key and title on the property pane perfectly i just need to display images from ...
0
votes
0
answers
72
views
RenderListDataAsStream Rest API not returning Field in ViewFields
RenderListDataAsStream is not returning some fields specified in ViewFields.
I need to retrieve ServerRedirectedEmbedUrl but doesn't return anything.
If I run the following CAML Query specifying the ...
0
votes
0
answers
23
views
PNPJS LastItemModifiedDate for list item not working as expected
I am using below SharePoint REST API to get any changes to the List Items and I am getting expected value
http://revamp.corp.xxx.com/_api/web/lists/GetByTitle('FormSettings')/LastItemModifiedDate
But ...
0
votes
0
answers
214
views
Get List Items with specific view by using SPFx with PnP/SP
I refer to the document from https://wowsomuch.com/sharepoint/pnp-js-caml-query/. When there are 3000 List items in specific view of List, the performance is not good (Low Performance). Does anyone ...
1
vote
1
answer
162
views
Remove user from site group using PnP-SP in JavaScript
I'm trying to find a way to remove a user from a group using PnP-SP. My code is as follows:
this.$pnp.sp.web.siteGroups.getById(this.selectedGroup.Id).users
.remove(user)
....
0
votes
1
answer
4k
views
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'substring')
I am using PnP JS in SPFx to get page content. I wanted to get content type id of the page and check if it belongs to certain content type.
I can't seem to make contain or includes function work so I ...
0
votes
3
answers
150
views
How to get the file length using PnP JS?
I know how to get the file size using REST API, basically this here:
https://tenant.sharepoint.com/sites/site_name/_api/web/GetFileByServerRelativePath(decodedurl='/sites/site_name/Lists/ListName/...
0
votes
0
answers
47
views
PnP JS in Chrome Extension
I am using PnP JS in chrome extension and all my GET requests working fine but when I make a POST call (like update listitem or add new listitem) it is giving out error. Basically it is trying to ...
0
votes
1
answer
564
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
0
answers
38
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
1
answer
20
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
0
answers
38
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
0
answers
19
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
0
answers
200
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
0
answers
83
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
1
answer
130
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
0
answers
83
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
1
answer
388
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
1
answer
1k
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
3
answers
813
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
1
answer
339
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
1
answer
154
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});
1
vote
0
answers
90
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
1
answer
486
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 ...
2
votes
2
answers
174
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
1
answer
150
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
2
answers
5k
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
2
answers
37
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
1
answer
1k
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
0
answers
120
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
1
answer
154
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
1
answer
718
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
1
answer
1k
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
1
answer
2k
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
1
answer
440
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
1
answer
448
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
2
answers
524
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 ...
1
vote
2
answers
164
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
1
answer
347
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
1
answer
106
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
1
answer
138
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
1
answer
299
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
1
answer
665
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....