Hot answers tagged

7

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 good state, may be that's worthwhile. In your case I think some kind of mess took place. But I can propose you some alternative option which I found pretty ...


7

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 below: $pnp.sp.web.select("AllProperties").expand("AllProperties").get().then(function(result){ // Select the AllProperties from the result console....


7

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-admin.sharepoint.com Set-SPOsite https://yoursharepinttenant.sharepoint.com/sites/yoursharepointsite -DenyAddAndCustomizePages 0 Connect-PnPOnline https://...


7

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 methods. Main method calling resua public getListViewData():void{ let listName = "Custom List"; //The display name of the sharepoint list. let ...


6

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 to start using quickly. Many times I found myself digging into source code for finding useful methods, approaches, etc. Today PnP is a broad terminology ...


6

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="100" Url="Lists/bookings" > <pnp:DataRows UpdateBehavior="Overwrite"> <pnp:DataRow> <pnp:DataValue FieldName="...


5

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 this post, the actual syntax for the List attribute should be: List="{listid:ListName}" The tokenized syntax is unique to the PnP provisioning engine, so it ...


5

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 provides support for open source tooling development. Note: The SharePoint Framework is till now not available for SharePoint On-Prem The SharePoint Framework is ...


5

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 provisioning template xml somewhat as below: <pnp:Providers> <pnp:Provider Enabled="true" HandlerType="PnP.ExtensibilityProviders.CustomProvider, ...


5

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 endpoints. Reference - Getting started with PnP JS


5

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 cd pnp_test npm init -y npm install @pnp/logging @pnp/common @pnp/odata @pnp/sp @pnp/graph @pnp/nodejs --save In order to send requests to on-prem SharePoint, we ...


5

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 using jQuery\REST you will create your own "pnpjs". In that case, why reinvent the wheel? pnpjs has some other things except just wrapping around REST. For ...


5

Change this part: table.append(`<td>${item.Title}</td>`); table.append(`<td>${item.Rank}</td>`); table.append(`<td>${item.Franchises}</td>`) to this: table.append(`<td>${item.Title}</td>`); table.append(`<td>${item.Description}</td>`); table.append(`<td>${item.Link}</td>`);


4

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 access token. That's why it doesn't work for you. Hopefully you have two options: Configure low-trust for on-premise farm (I would say complicated scenario, ...


4

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 endpoint to determine if a site collection exists or not import { sp } from "@pnp/sp"; import { SPHttpClient } from "@pnp/sp"; 2) Modify your code as below, I ...


4

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 and modified by fields. You can modify from below sample code for Active projects : $listItems= Get-PnPListItem -List "Project Management" -Query "<View>...


4

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 -Url "<your-site-url>" -ErrorAction SilentlyContinue } Catch { } if ($site -ne $null) { Write-Host "Site already exists, use existing..." } else { ...


3

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 type="button" value="Upload" onclick="UploadFiles()" /> Now, in your UploadFiles method, you can upload the file using getFolderByServerRelativeUrl("server-...


3

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 the Debug versions you compiled, and the debug symbols to be available. You might have to fudge the version number in AssemblyInfo.cs to match whatever's ...


3

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 web part model, allowing you to create rich UI experiences with modern technologies. For now it's not available for on prem, but there are plans to add it. ...


3

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 module which has this cmdlet. Run import-module 'C:\Program Files (x86)\CorrectPath\OfficeDevPnP.PowerShell.V15.Commands.dll'. It should work then.


3

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 then you must update manually your XML schema to add pages to provision them in a new site. Have a look on the schema definition to update your XML Schema. ...


3

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 then pass it to the Set-PnPListItemPermission command. To do that, you can use it as below: $listItem = Get-PnPListItem -List 'Test' -Id 1 or passing CAML ...


3

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 is used as mailNickName property for the underlying Office365 group and it cannot contain special characters like slash(/), colon(:) etc. Try giving alias ...


3

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 details: https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs Now about your main question regarding the ...


3

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-SPOSite = Set-PnPSite Get-SPOSite = Get-PnPSite Add-SPOSiteCollectionAppCatalog = Add-PnPSiteCollectionAppCatalog


3

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}</td><td>${item.Rank}</td><td>${item.Franchises}</td></tr>`) That way, you get valid rows within your table body.


3

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(this.context.pageContext.list.id.toString()) .items.getById(this.context.pageContext.listItem.id) .select("Footer1","Footer2","Footer3") .get() ...


3

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


3

The best recommended approach is use the PnP Provisioning template. Download the PnP Provisioning template using PnP Filter the downloaded template (xml) because there is no way to generate only the specific list template, by default it will download all lists/libraries from the specific site. Then create a new list using the filtered PnP template. ...


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