150 questions
-4
votes
1
answer
57
views
Access SharePoint REST API (/_api/web) from a C# backend — get token programmatically (no login popup)
Problem:
I need to call the SharePoint REST endpoint https://{tenant}.sharepoint.com/_api/web
programmatically from a C# backend service without any Microsoft login popup.
I already have these values:
...
0
votes
1
answer
27
views
SharePoint REST API returns old site title for group-connected site even after update
I'm trying to fetch the live title of a SharePoint Online site using the REST API, but it keeps returning the old title even though the site title was updated hours ago.
Here’s my current code:
export ...
0
votes
1
answer
60
views
PnPjs Library: Create Sharepoint site fails with HTTP 400 response
I'm trying to create a SharePoint site using PnPjs library, but it fails with an HTTP 400 error. Any idea what might be causing this?
Reference: Creating a modern team site with PnPjs
Library: @pnp/sp
...
1
vote
1
answer
67
views
How to get total item count of filtered items from sharepoint list using PnP js
I want to implement pagination in my spfx webpart to show filtered list items. My list is having more than 5000 items, the filtered items may or may not be more than 5000. On each page i want to show ...
0
votes
0
answers
32
views
Determine if a user has previously opened / viewed a file
I am using spfx v.1.21, and pnp/sp v.4.15
I have created a webpart to display contents of a library in a custom way.
Is there a property I can read or some other way I can determine if the user / ...
1
vote
1
answer
91
views
SPFX v1.9 - TypeError: Cannot read properties of undefined (reading 'web')
I've made application SPFx with React. It's working when I enter the page where is the app. But when I refresh the page or go to the preview, I'm getting error: caught (in promise) TypeError: Cannot ...
0
votes
0
answers
93
views
SPFx + PnPjs: Upload failed – „context.pageContext is undefined“
I am developing an SPFx WebPart using PnPjs to upload files to a SharePoint document library.
However, when attempting to upload a file, I receive the following error:
Upload failed: TypeError: ...
0
votes
1
answer
103
views
@pnp/spfx-controls-react/lib/PeoplePicker control return only one value at a time i need object of username and email
in @pnp/spfx-controls-react/lib/PeoplePicker control when i select one user that control return object but when i edit manage content selected user not display in peoplepiker control
i need object of ...
0
votes
1
answer
107
views
how to connect excel sheet in sharepoint by nodejs
I have this code to download and upload excel sheet to microsoft sharepoint but seems it's not working due to some version issues or something other.Is there other way to connect to sharepoint with ...
0
votes
1
answer
254
views
Best way for provisioning Content Types and Columns in SharePoint Online
There are many ways for provisioning columns and content types in SharePoint Online.
One could use Site Templates and Scripts, PnP Provisioning, create them via Code/PowerShell or just use the ...
0
votes
1
answer
27
views
Init pnpjs/graph inside a word office addin
We want to read a JSON file from a SharePoint document library to provide our Word add-in with selection data.
We are currently testing the possibility of doing this using the pnpjs framework.
...
0
votes
1
answer
272
views
Who has file open in SharePoint
We have lots of sites and files in SPO
In an SPFx webpart, I need to warn the user about a certain file being open by any user.
I use PnP/JS getLockedByUser() function of IFIle type to get the current ...
1
vote
1
answer
76
views
How can I use a person field in a control @pnp/spfx-controls-reactComboBoxListItemPicker?
I use this configuration:
<ComboBoxListItemPicker
listId='<LIST_ID>'
columnInternalName='Author/Title'
keyColumnInternalName='ID'
webUrl='<WEB_URL>'
defaultSelectedItems={[...
0
votes
1
answer
862
views
Which versions of SPFx, PnPjs, and @pnp/spfx-controls-react should be used together?
I am working on a SharePoint Framework (SPFx) project and I'm having trouble determining the correct versions of SPFx, PnPjs, and @pnp/spfx-controls-react to use together. Specifically, fir the ...
1
vote
0
answers
112
views
Api not working after nodejs updated to version 18
We recently updated runtime nodejs 18 after that one api got failed and return 500 internal server error.
Also thrown this error in server
TypeError: Failed to parse URL from
at .Request ( node:...
0
votes
1
answer
73
views
How to simulate choosing an icon from the PnP Icon Picker in a Jest unit test?
I am using the PnP icon picker in a react web site.
Is it possible to simulate the selection of an icon in a Jest unit test with this component? It seems not...
This is the Icon Picker:
<IconPicker ...
1
vote
1
answer
968
views
"HitHighlightedSummary" property is not returning the searched keywords with <c0> tag, else it returns only plain text in PNP modern Search v4
I am using PNP modern search V4 webparts in SharePoint online site. where i have linked search box and search results webpart. i need to highlight the Searched keyword in search results, i referred ...
2
votes
1
answer
396
views
How to transform a class component to a functional component in SPFx React.js and get value from a SharePoint list
I have a written a class component in SPFx with the pnp/js framework and React.js. I need to transform it to a functional component in react. I'm struggeling to call my SharePoint lists now.
I have a ...
0
votes
2
answers
1k
views
SPFx React - error Cannot read properties of undefined (reading 'web')
I've made application SPFx with React. It's working when I enter the page where is the app. But when I come back or go on another page and then go back to the page with app, I'm getting error:
...
0
votes
0
answers
73
views
When clicking on Tile, I want the sharepointpage to be redirected to a new sharepointpage, which url comes from the Hyperlinkcolumn Lien. How?
I will start with the images:
First the view is the colored tiles. what I want is when I click on a Tile, it has to redirect our sharepoint online to page to another page. The Url comes from the ...
0
votes
1
answer
192
views
Get-PnPWebPart - how to get the web parts in the same order it is used in the page
I am using pnp library to retrieve the Webparts used in the Sharepoint page using this
Get-PnPWebPart -ServerRelativePageUrl "path-to-files/test.aspx"
But the order in which the webpart is ...
1
vote
1
answer
594
views
How to get the document ID's from the selected documents in SPFx listView extension?
I have a folder with documents and a SharePoint listView extension.
I want to be able to retrieve the Document ID's after selecting documents in the folder in order to perform Graph API requests with ...
0
votes
1
answer
389
views
How to create custom section layout options for SharePoint online modern site pages?
SharePoint provides default layout options below as mentioned in the screenshot. How can we create custom section layout options as per our needs? If there are any ways to create custom section layout ...
0
votes
2
answers
669
views
Trying to use Set-PnPList -Identity "TestLib" -DefaultSensitivityLabelForLibrary "Restricted" to set sensitivity label to SharePoint Document Library
I have a requirement to add sensitivity label to document libraries of multiple site collections.
I found below PnP PowerShell Command as per https://pnp.github.io/powershell/cmdlets/Set-PnPList.html
...
1
vote
0
answers
418
views
Paging for SPFx Solutions with PnP Pagination Control using ES6 or Vanilla JavaScript
All the PnP Pagination example use React code (example 1, example 2, example 3) Does anyone know how to use PnP pagination using vanilla JS or ES6 with SPHttpClient? I am using no-framework SPFx and I ...
0
votes
1
answer
188
views
How to submit people picker value from Teams to SharePoint
I've created a Teams webpart (hosted in Teams). I'm using an sp/pnp people picker to allow the users to choose a person. I want to submit this to a separate SharePoint site (not the one behind the ...
0
votes
2
answers
1k
views
Login to SharePoint using PnP PowerShell Module and an Access Token
This is my first question here in the community!
I'm trying to connect to a SharePoint site using the PnP PowerShell Module and an access token, but I'm still not being able to make it work.
The ...
1
vote
2
answers
756
views
Using pnpjs 8.15 in SPFx - get() is not a function
New to pnpjs, using 8.15.0 trying to get a list of lists in a SPFx.
I'm getting error: TypeError: this.sp.web.lists.get is not a function. I have list item updates working in this same ts file. ...
0
votes
1
answer
518
views
How to get SharePoint online site usage report using sp/pnp?
I have created SharePoint Framework Solution for custom development in the SharePoint Online.
I need to display SharePoint site usage report in my SPFx web part.
I have tried with @pnp/graph and @pnp/...
0
votes
1
answer
59
views
Accessing Word Automation Services using pnpjs
We are investigating using SharePoint, SP, Word Automation Services, WAS, on demand to render Table of Contents, ToCs in word documents we are generating, prior to sending them to a third party vendor....
0
votes
1
answer
721
views
Get data from another sharepoint list while we store id in my current list?
I have a category list in SharePoint which have all categories in my list:
While it is sub-category list which has all sub-categories
And I also have third list which have items and the respective ...
1
vote
1
answer
1k
views
PnPjs: Filtering SharePoint document library by file name results in errors
I am working on a new web part to display a list of files in a SharePoint document library called Medicine files. I want users to be able to filter the files based on different columns, including file ...
0
votes
1
answer
575
views
How to retrieve data from list in SPFX solution
I have 3 components - RequestSHP.tsx, WebPart.ts, Exekucie.tsx
I am trying to get data to dropdown from list, but getting error "404 (Not Found)"
Here is my RequestSHP.tsx ->
import {sp} ...
0
votes
1
answer
574
views
Enable the "Make "New Folder" command available?" option with Sharepoint using @pnp/sp
I need to create folder under Site Pages library under SharePoint Online site.
I have tried to create the folder programmatically using @pnp/sp library. But it thrown me Access Denied error.
New ...
0
votes
1
answer
4k
views
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'web') when using sp pnp v3
I am developing a webpart for my sharepoint tenant. When I test my solution on my workbench everything works well. But when I put it on my sharepoint online I get the error described in the ...
0
votes
0
answers
103
views
Provisioning of SharePoint Site and Lists from the MS Teams Personal App
I would like to provision a SharePoint Site and Lists from the Microsoft Teams Personal App.
I know that can be done if used as channel app.
But my requirement is to provision site/subsite from the ...
0
votes
0
answers
103
views
SPFx - list username shows in console but not when mapping out object array
I have made a simple SPFx application that is supposed to fetch data from a list in SharePoint Online called "Users". I am using PnP sp to get the list items and the data shows in ...
0
votes
1
answer
542
views
While we are create list and list columns using "pnp/sp". Why some of the columns are not created in one go?
While we are create list and list columns using pnp/sp. Why some of the columns are not created in one go? We need to run again then it will created. Please help me to resolve this issue.
I have used ...
0
votes
1
answer
217
views
Issue using PropertyFieldPeoplePicker target audience control in no JS framework SPFx
I follow the instruction https://pnp.github.io/sp-dev-fx-property-controls/controls/PropertyFieldPeoplePicker/ and setup target audience in React without any issue but it is not working for No JS JS ...
0
votes
1
answer
477
views
Pnp.js Access to sub site
I use PnPJS within an REST API route like this:
pnp.sp.web.lists.getByTitle("t").reserveListItemId().then(v => {
pnp.sp.web.lists.getByTitle("t").items.add({
ID: v,
...
0
votes
0
answers
75
views
How to find out that the user's login time has expired in sharepoint with pnp js?
I know when error 403 in a request that's mean user does not have access.
But if the login time expires , again request give error 403.
can you help me?
I looked in other sites but I did not find the ...
1
vote
1
answer
1k
views
How to get the publishing state of a given page?
Currently I'm trying to get some information of the publishing state of a given page.
Maybe anybody has an idea for this issue.
Thanks in advance
To get information about the page I use pnpjs to ...
1
vote
1
answer
794
views
How to get user department, phoneNumber with PeoplePicker
I am working in SPO (SPFX react js application) and successfully PeoplePicker work, but I am wondering how to get to console.log department and phoneNumber (already can get loginName, id, displayName)
...
0
votes
1
answer
482
views
PnP JS handle error if case "overwrite: false" enters
My Code:
try{
if (file.size <= 1048) {
result = await sp.web.lists
.getByTitle(documentLibraryTitle)
.rootFolder.files.addUsingPath(fileNamePath, file, { Overwrite: false });
}
...
2
votes
2
answers
755
views
How to configure a spfx extension at runtime like ENV vars?
If i write for example a node express app, i have the opportunity to pass some env vars from the server configuration.
Is there an opportunity in SharePoint Online also?
As SharePoint Online is a ...
1
vote
1
answer
1k
views
pnpjs get sharepoint items by view issue
I'm trying to get items from large lists using pnpjs/sp
I created a promise like this:
try {
// const sp = spfi();
const sp = spfi().using(DefaultInit(), DefaultHeaders(), BrowserFetchWithRetry(), ...
0
votes
1
answer
778
views
A way to fetch Microsoft Graph locations with PnPJs
As stated above in the title I am currently facing issues fetching graph places with PnPJs, using the @pnp/graph graphfi factory interface in SPFx.
I am currently able to fetch data from my events via ...
0
votes
0
answers
869
views
How to properly upload multiple attachments to sharepoint using pnpjs?
I need the users to be able to upload attachments. then i need to display the attachment so it can be selected and viewed.
sometimes there may only be a single attachment. sometimes multiple.
file ...
0
votes
1
answer
401
views
How Can I See all Of The Available Additional Identifiers For A SharePoint Column
Sorry for the weird question as I am really just learning SharePoint and do not know the best vernacular.
at work, we have code that accesses a sharepoint list item, then selects and expands the ...
1
vote
0
answers
2k
views
How to use pnp/spfx controls people picker with functional react and no this keyword in my sharepoint project?
I need to use this pnp/spfx people picker in my functional based react project.
https://pnp.github.io/sp-dev-fx-controls-react/controls/PeoplePicker/
But all of the tutorials and images across the web ...