Web/Site Templates in SharePoint Online Modern Pages? No problem.

Let’s imagine that we want to have site template with predefined design, sections, web parts on it, lists with additional fields, custom page settings etc. etc.

If you are familiar with SharePoint On-Prem versions there we have Site Definitions and Web Templates for stuff like this. But what can we do now in SharePoint Modern Sites times in a combination with SharePoint Online?

We have to learn something new – there we have Site Scripts and Site Designs for some specific common steps in creation process of our Web/Site Templates. What you could do with Site Scripts you could see on that link.
But scope of modifying with Site Scripts is a lil’bit small, so we have to take a look into alternatives.

In SharePoint world we have SharePoint PowerShell modules – so we could use PowerShell to modify our Modern Pages in SharePoint Online. But we want to make this happen automatically when new Web/Site was created -> so we want to make this happen with Web/Site Template.
That is possible only with Site Scripts and Site Designs. Fortunately we could connect our PowerShell scripts with Site Scripts and Site Designs via Microsoft Flow, which could call Azure Function App which contains PowerShell script.

But PnP team go further with PnP Provisioning Engine in their PnP PowerShell modules where you could easly specify Web/Site Template in one XML file and put it into your PowerShell script which is called from Site Scripts via Flow.

Let’s take a look into a simple example.

Continue reading “Web/Site Templates in SharePoint Online Modern Pages? No problem.”
Advertisements

Anonymous CreateTerm leads to UnauthorizedAccessException and ArgumentNullException

Today is time for new post, new hack inside of SharePoint environment šŸ™‚

Let’s imagine that we want to create new Term inside of specific Term Set within specific Term Store. But we want to create it as anonymous user, because we want to make this functionality available inside of some public page without login needs.

We could make this possible with code which runs inside of RunWithElevatedPrivileges scope. But creating term process differs from other creating processes inside of SharePoint (list item creation, file upload etc.).

Let’s take a look to this topic.

Continue reading “Anonymous CreateTerm leads to UnauthorizedAccessException and ArgumentNullException”

Working with Comments on SharePoint 2019 Modern Pages

With SharePoint 2019 we get new Modern Pages. With Modern Pages we get completely renewed Comments feature which looks like that example on image above.

On SharePoint 2019 you could currently use only Comments without Like and Views feature as on SharePoint Online (image below).

There is a new Comment REST API from where you could read / write comments for specific page and it is available on SharePoint 2019 and SharePoint Online. More about that you could read in that blog post from @vrdmn.

What I want to show you today is how you could programmatically read this comments from SharePoint SSOM.

Continue reading “Working with Comments on SharePoint 2019 Modern Pages”

Read user information from Skype for Business Online with Azure Function App

Let’s imagine that we want to create Address Book SPFx Web Part in which we want to have option to find and show details of our coworkers.

If you want to build it from scratch, you could choose TextField and DetailsList from Office Fabric UI. First for search box and second for showing results as you could see above.

But let’s take a look behind-scene – how we could search users from Azure AD and how could we get some of their additional information.

Continue reading “Read user information from Skype for Business Online with Azure Function App”

Import PowerShell Module / Package into your Azure Function App

If you have a concern about how you could use external PowerShell Modules or Packages inside of you Azure Function App written in PowerShell language then you could read this blog post where I want to show you my solution for that.

First of all you have to know that if you want to write Azure Function with PowerShell language support, then you have to use Function App with RuntimeĀ versionĀ 1.0 – so you couldn’t use latest runtime version 2.0 because there is no support for PowerShell language.

But why use PowerShell in Azure Function App? Let’s imagine scenario that we want to connect to Skype For Business Online API to which you could connect only from PowerShell.

But in that case we have to import specific PowerShell Module or Package into Function App in Azure.
You cannot simply call Import-Module SkypeOnlineConnector like on your local machine where you have previously installed SkypeOnlineConnector from that site. But you have to copy all files from that locally installed package into specific folder inside of your Function App in Azure.

So let’s take a look how you could do that.

Continue reading “Import PowerShell Module / Package into your Azure Function App”

XsltListViewWebParts with Paging problem or SaveChanges error

Let’s imagine, that we want to have SharePoint Library Template with more than 90 Views.

We want to define this views inside of List Schema.xml file because this is the easiest way for fast provisioning of SharePoint lists and their views. But there is the limit – List definition in Schema.xml file could contains max 90 views!

So we have to choose another way – we could define this views “by code”. We could make just few common views by Schema.xml and other could be copied from them with list.SaveAsNewView() function from SharePoint SSOM and then we could modify it by code.

After that we want to add this list views to some pages at SharePoint. Default views, made inside of Schema.xml could be added to page “by xml” with XsltListViewWebPart where we have to define BaseViewID for each view.

But views, created “by code” could be added into pages “by code” too. And here we could have problems with some SharePoint versions.

Continue reading “XsltListViewWebParts with Paging problem or SaveChanges error”

O365 SharePoint Suitenav: Add custom button

Today I want to show you, how you could add custom button to the right side of top Office 365 SharePoint SuiteNav / SuiteBar like in an image above.

For this suitenav we don’t have any official way in SharePoint 2016 like we have at SharePoint 2013 with SuiteLinks Delegate Controls.
Officially you could add only custom tiles on your App Launcher to the left side of SuiteNav named App Launcher Tiles – but only with SharePoint 2016 Feature Pack 1.

So we have to go in own way. I want to share with you how I have done this with JavaScript and a lil’bit hacking.
Just for information -> suitenav links are officially created with JavaScipt too.

Continue reading “O365 SharePoint Suitenav: Add custom button”

SPFx and Microsoft Bot – Starting point

Today I want to share with you something new within my blog – Microsoft Bot Framework.

And because I love SharePoint and I work with it for a while, SharePoint Framework (SPFx) and MS Bot Framework is my way to start this journey.

As anything in this world is mandatory to begin with starting point. And here we are – how we could start using Microsoft Bot Framework inside of our SharePoint Framework (SPFx) and create HelloWorld-like example in Bot Framework?

Continue reading “SPFx and Microsoft Bot – Starting point”

Powered by WordPress.com.

Up ↑