Hot answers tagged

8 votes
Accepted

How get sharepoint list items by view(s) in spfx?

I am afraid you can't get items directly from view. You will get viewQuery field from below method using v.ViewQuery. then you have to use getItemsByCAMLQuery method to get items. Below are reference ...
user avatar
7 votes
Accepted

How should I update the Office SharePoint PnP PowerShell Commands?

It's ok to uninstall and install it again, because they are simply copying files into the file system. Actually uninstalling is not required, but just to make sure that everything is fresh and in a ...
user avatar
7 votes
Accepted

PnP-JS-Core Property bags

You need to use it as below in typescript: pnp.Web(this.url).select("Title", "AllProperties").expand("AllProperties").get().then(r =>{ console.log(r); }); So pure javascript would be as ...
user avatar
  • 30.3k
7 votes

How to Provision a list with data using SharePoint Online PnP C#?

I have done a similar thing recently and have written an article about it. You can easily achieve this by running some SharePoint PowerShell commands. Connect-SPOService -Url https://yoursharepoint-...
user avatar
6 votes

How to use the patterns and practices

You're absolutely right about documentation. IMHO, documentation is the weakest part of the PnP library. They did a lot of cool things in the library, but without good documentation is extremely hard ...
user avatar
6 votes

How to Provision a list with data using SharePoint Online PnP C#?

i managed to do this by adding rows as XML, a alternative option for some scenarios, perhaps? <pnp:Lists> <pnp:ListInstance Title="bookings" Description="bookings list demo" TemplateType="...
user avatar
5 votes
Accepted

Creating a lookup list field with OfficeDev PnP Provisioning Engine

I ended up fixing this issue. It was due to the fact that the lookup field was in a sub web and there was a bug in the PnP Core that I fixed and issued a pull request for. For anyone who stumbles on ...
user avatar
5 votes
Accepted

sharepoint framework and pnp

The SharePoint Framework (SPFx) is a page and part model that enables client-side development for building SharePoint experiences. It facilitates easy integration with the SharePoint data, and ...
user avatar
5 votes
Accepted

How to Provision a list with data using SharePoint Online PnP C#?

This is by design. PnP will only migrate the structure and content types and not data. To provision the data, you will need to write a custom extensibility provider. You need to write that in your ...
user avatar
  • 30.3k
5 votes
Accepted

PnPJS with on-prem sharepoint?

It is indeed possible to use PnP JS with SP OnPremise. It supports both 2013 and 2016 as well as the upcoming 2019 environment. Under the hood, it is just a wrapper over the existing REST API ...
user avatar
  • 30.3k
5 votes

PnPJS with on-prem sharepoint?

UPDATE JUNE 2019: Some things were changed in regards to PnPjs library and nodejs integration. Please read below updated guidance on how to use it with on-prem SharePoint and Nodejs: mkdir pnp_test ...
user avatar
5 votes
Accepted

PNP JS in SharePoint

For me the answer is pretty obvious: for sure you should use it. A few things why I think so: the learning curve is very straightforward and not so difficult pnpjs is a wrapper on REST API, by ...
user avatar
5 votes
Accepted

Unable to pull in Number/Lookup Columns using pnp.js

Change this part: table.append(`<td>${item.Title}</td>`); table.append(`<td>${item.Rank}</td>`); table.append(`<td>${item.Franchises}</td>`) to this: table....
user avatar
  • 3,536
4 votes

sharepoint framework and pnp

SharePoint Framework (SPFx) is something completely new and it doesn't have direct relations to pnp and CSOM (besides some guys from PnP team involved into SPFx program too). SPFx is a new page and ...
user avatar
4 votes
Accepted

OfficeDevPnP.Core AuthenticationManager GetAppOnlyAuthenticatedContext is throwing error

Your are aboslutely right about ClientSecret is not necessary for high-trust apps. Unfortunately GetAppOnlyAuthenticatedContext works only with low-trust apps and uses AzureACS in order to obtain ...
user avatar
4 votes

PnPJS - Check if site collection exists

You can check whether site collection exists or not as below: 1) Add the below import statement, we will be using the SPHttpClient provided by PnPJS to make a REST call to /_api/SP.Site.Exists ...
user avatar
  • 30.3k
4 votes
Accepted

Can i using PnP script Update our custom list items "Status" field without affecting the ModifiedBy and Modifed fields

Yes, you can use Get-PnPListItem with CAML query to fetch the based on your conditions and then update them using Set-PnPListItem and passing the SystemUpdate parameter which wont change the modified ...
user avatar
  • 30.3k
4 votes

New-PnPSite - Check if site is allready created?

You can use the Get-PnPTenantSite command to check if a site collection exists or not as below: $site = "" Try { Write-Host "Checking, if site already exists..." $site = Get-PnPTenantSite -...
user avatar
  • 30.3k
3 votes
Accepted

Sharepoint Online upload files to library with PnP-JS-Core 2.0.7

You can try the below approach using the FileReader API : Assume that you have html structure somewhat as mentioned below: <input type="file" id="uploadFile" value="Upload File" /> <input ...
user avatar
  • 30.3k
3 votes
Accepted

Does AnyOne Know how to Debug SharePointPnP.PowerShell

Copy your build output into the Program Files directory for the module version you have installed, usually found here: C:\Program Files\WindowsPowerShell\Modules That should make the runtime to load ...
user avatar
  • 25.5k
3 votes

SharePoint Responsive Package PNP tools not able to enable feature in Package

Download and install the PS commands from http://aka.ms/officedevpnpcmdlets15. It should unpack the dll's to C:\Program Files (x86)\OfficeDevPnP.PowerShell.V15.Commands. You then have to import the ...
user avatar
  • 2,871
3 votes
Accepted

Sharepoint PNP Get Page Content

I'm faced the same issue few months ago. According to the Office PnP source code, that behavior is not implemented (Ref: ObjectPageContents.cs). You have to extract yourself pages and their contents ...
user avatar
3 votes
Accepted

understanding set-pnplistitempermission

By list item object, it means passing the Microsoft.SharePoint.Client.ListItem object. You are currently passing string which will not work. You need to use Get-PnPListItem to get the list item and ...
user avatar
  • 30.3k
3 votes
Accepted

Create Modern Team site using PnP Core - Invalid value specified for property 'mailNickname' of resource 'Group'

Creating a modern team site also creates unified group in Office365 that is associated with the newly created team site. The PnP package takes care of this but under the hood it seems that alias name ...
user avatar
3 votes
Accepted

How to configure SPO to do app-only auth with PFX private key?

About the GetAppOnlyAuthenticatedContext method, an easier way to register for an app id and app secret is by registering an app (add-in) in SharePoint Online itself. This article should give more ...
user avatar
3 votes
Accepted

Can I get a list/library's Relative URL using PnP when I have its ID?

You need to expand the RootFolder property of a list. Modify your code as from below sample code : sp.web.lists.getById([THE ID]).select("Title","RootFolder/ServerRelativeUrl") .expand("RootFolder")....
user avatar
  • 30.3k
3 votes
Accepted

Alternative PnP commands to SharePoint Online Commands

Please see below, You can get the complete list of PNP commands here Connect-SPOService = Connect-PnPOnline Disconnect-SPOService = Disconnect-PnPOnline Set-SPOUser = nothing equal for it. Set-...
user avatar
  • 56.7k
3 votes
Accepted

SharePoint List to HTML Table to TableExport.js

Your table HTML is not valid since you are appending table related tags just one after one. Plus, you should put your closing tbody tag after the loop. table.append(`<tr><td>${item.Title}&...
user avatar
  • 367
3 votes
Accepted

Retrieve column value (page property) by site ID from Site Pages list

You are on the right track. Based on the code that you posted in the question, am assuming that you are using pnpjs. Using that, we can get the page properties as below: pnp.sp.web.lists.getById(...
user avatar
  • 30.3k
3 votes

@pnp/sp - send email function returns 404

Sorry, stupidity on my part. Correct code is: sp.setup({ spfxContext: this.props.context });
user avatar
  • 143

Only top scored, non community-wiki answers of a minimum length are eligible