Tuesday, June 20, 2017

Re-introducing Microsoft Forms

About a year ago I wrote a post outlining the Microsoft Forms functionality which at the time was available only to educational tenants (EDU license).

This time around Microsoft has decided to launch a preview of the same functionality to enterprise tenants as well – and about time as it’s a nice little application indeed.

So what is Microsoft Forms? It’s an application to create simple forms, surveys and quiz's. It’s not a replacement for InfoPath, it’s not a replacement for PowerApps, but it sits somewhere in-between, and is really easy to use.

Read my original post for an in-depth review

Thursday, June 15, 2017

How to remove the banner on modern pages from the UI

I have previously written about how to change the layout type of a modern page using PnP PowerShell in order to get rid of the huuuuge top banner. Yes,  I know Microsoft is in the works of adding functionality to the UI to allow header changes, but until that happens I figured I’d show a way to accomplish the same for a Power User.

The layout of a modern page is handled by a column named Page Layout Type (PageLayoutType), and it’s part of a sealed content type named Site Page.

You cannot modify a sealed content, and the Page Layout Type column is hidden, so we need a tiny bit of trickery to get this working.

In your site, navigate to site settings, and to site site content types. Or tack /_layouts/15/mngctype.aspx at the end of the URL to go there directly.

Create a new content type named My Site Page which inherits from the Site Page content type.

image

Copy the content type id from the URL in your browser and create the following URL:

https://contoso.sharepoint.com/teams/modernisthenewmodern/_layouts/15/ManageContentTypeField.aspx?ctype=0x0101009D1CB255DA76424F860D91F20E6C411800FA0F5B1F8210094AB33AED9F195597A5&Field=PageLayoutType

On the column screen, make no changes, just hit OK. This will make the column visible later. Next, navigate to the Site Pages library and go to library settings and add the previously created content type.

image

You are now ready to create your site or news page. Once the page is created and saved:

  • navigate back to the site pages library
  • select the page you created
  • click the information icon
  • change the content type to My Site Page

You will now see the Page Layout Type column visible. Change the value from Article to Home, and the banner is gone. You can change the content type back to Site Page after you have changed the layout to ensure any search based experience relying on the base type is still working.

image

Look ma, no banner!

image

Summary

Once set up, you can per page change the content type to your custom one and change the layout to get rid of the banner. It’s somewhat convoluted, but it is doable from the UI :)

Wednesday, June 7, 2017

Accessing Microsoft Graph resources from the SharePoint Framework

You can find the complete sample web part at: https://github.com/wobba/spfx4fun/tree/master/GraphCallTest

With the recent release of the Developer Preview of the SharePoint Framework it’s now possible to start running queries against the Microsoft Graph without the use of ADAL.

The savior in this case is the introduction of the GraphHttpClient class (which at the time of writing this does not have a documentation page).  If you decode the Bearer token used by GraphHttpClient you can see the following permissions being available:

The Groups permission lets you read information about Office 365 Groups, but not everything as stated in the documentation. You can read the basic information about the group as well as Exchange data like calendar events, but I got access denied when trying to list members of a Group.

Friday, June 2, 2017

Azure AD management portal if you don’t have an Azure subscription

I got this tip from Paul Schaeflein via Slack that if you navigate to https://aad.portal.azure.com you can access the AAD of your tenant without signing up an Azure subscription. Awesome for trial tenants and managing app registrations and other AAD tasks in an quick an easy way.

You can also read the May 15th announcement for the portal from the TechNet blogs.

image

Wednesday, May 31, 2017

Timeout when applying a composed look (branding) to a Team Site in an Office 365 Group

As I’ve written about before, when you create a new Office 365 Group, the Team Site will get a random funky color, often pink – a color most organizations would like to change. This can be changed by applying a composed look, specifying your own custom fonts and colors matching your own style guide.

Recently I experienced an issue when applying a composed look to the team site for an Office 365 Group where it timed out, and the colors was not applied. I opened up a support ticket and now know the reason and how to resolve it.

The culprit is that a team site by default have all languages available, and when applying a composed look it will apply this per language. There might be a technical sound explanation for this which I’m not aware of, but here goes.

image

Before applying the composed look, turn off all languages except the default one (/_layouts/15/muisetng.aspx). Apply the composed look without any timeout issues what so ever, and then re-enable the UI languages you need on the site.

Wednesday, May 24, 2017

Random gotcha when filtering values greater than 0 in PowerBI

This might be know to all PowerBI guru’s out there, but as I’m a newbie doing this and couldn’t find an article right away I figured I’d jot it down for future reference. And a big thank you to my colleague Marius (the CRM Viking), for letting me in on this secret.

I was trying to add a filter to a visualization, showing only values greater than 0.

image

for some unknown reason this did not work for some of my datasets. I could see a big fat zero in the data set, but the data still showed after I applied the filter. Changing to “is greater than or equal to 1” did the trick.

image

Could be something obvious wrong in my data transformation – but might be worth trying if you are trying to filter on values greater than zero/0.

Thursday, May 18, 2017

Three reasons why you should take control of Office 365 Groups creation

Office 365 Groups are here to stay and I’ve gotten to love them more and more, and for the past six months this is primarily what we at Puzzlepart are rolling out with our customers. If you’ve followed some of my work recently you know that I do a lot of work on provisioning solutions. Not as is a lot of code, but help organizations figuring out business needs and orchestrating them programmatically.

A provisioning solution is the code and logic which creates the pieces of for example an Office 365 Group. Instead of having Microsoft do everything, we add custom business logic on top of the default parts to solve other business needs.

In this post:

You can very well run with the out of the box ways to create new Office 365 Groups, but our customers often experience this to be lacking in many ways – as they want more metadata and governance around the groups themselves. Especially on the associated team site.

image

By creating an alternative self-service solution, for example based off a SharePoint list, you get more control. Below I’ll list my top three reasons why you might want to take control over the Office 365 Groups creation, and I’ll follow up with what has to be in place to make this work.

Tuesday, May 16, 2017

Using Azure Information Protection (AIP) Labels in SharePoint search

Azure information protection let’s you classify and add policies to documents regardless of where they are stored, but is tied to an Office 365 tenant. AIP operate directly on the Office files, and is currently available when using the desktop versions of Office (versions 2010/13/16)  on Windows (versions 7/8/10) – when you have installed the AIP client.

This means that even though you save copies or e-mail the files, AIP is still tied to the document.

Note: See the pricing plans page to see which SKU’s include AIP.

Resources about AIP

The Office Graph is dead, long live the Microsoft Graph!

Yesterday Microsoft announced two new Insights endpoint (in beta) to the Microsoft Graph in addition to the trending one which was already there. The new endpoints are:
  • Used - returns the most relevant documents that a user viewed or accessed
  • Shared - files shared with or by a specific user
All great news, but at the same time Microsoft announced discontinuation of the Office Graph GQL API’s – effectively killing the last remains of what was formerly known as the Office Graph. This means as of August 31st 2017, calls using GQL on the SharePoint search API will no longer work.

By June 1st you need to add the parameter EnableLegacySPOGraph=true to your GQL calls to extend the life until the final cut off date August 31st.

rip graphReaper and halo’s!

Monday, May 15, 2017

Saving a collection of images from PowerApps to SharePoint using Microsoft Flow

Yesterday I wrote about how you can save an image from PowerApps to a SharePoint library using Microsoft Flow – after reading about Paul Culmsee’s approach using Azure Functions. Paul challenged me to save a whole collection of images, and not only one image, so here goes!

This solution loops the images in Flow, but you could easily have looped them in PowerApps as well, saving one image at a time upon submit.

I’ll start with the Flow, and this time we’ll use one input only. And this is where it get’s a bit nasty. A Flow can only accept strings as input from PowerApps, not a collection of items. To overcome this, I’m concatenating the data into one string in the PowerApp, and then splitting the data in the Flow.

The data being passed in looks like this:

Monday, May 15, 2017LT.jpg|data:image/jpeg;base64,<data>#
Monday, May 15, 2017AB.jpg|data:image/jpeg;base64,<data>#


First is the filename with a readable date (borrowed code from Paul), next a pipe | to separate the filename from the base64 encoded image. And at the end a hash # to separate each image from each other.

In Microsoft flow create a new Flow named “Save Images”

Add a “PowerApps” step, followed by a “Compose” step.

image

In the input field for the “Compose” step pick “Ask in PowerApps”. Next change the formula to:

"@split(triggerBody()['Compose_Inputs'], '#')"

and rename the compose action to “Split images” for readability. This will split the incoming string on the character #, creating an array with one item per image.

Note: Remember to include the double quotes around the formula.

image

Below the “Split Images” action, add a “Filter array” action. This action is used to remove the empty element we get at the end when creating the data string in PowerApps. Use the Output from the previous action as the “From” field, click “Edit in advanced mode” and use the following formula to remove empty values. item() will yield one item in an array.

@not(equals(item(), ''))

Note: No quotes here :)

image

Below the Filter array action, add a for each item loop, so that we can process each image sent over.

image

Pick the Body output from the Filter array step as the input in the for each.

image

In the for each action, add two compose steps. Rename one to “Filename” and the other to “File content”.

For filename add the expression:
"@split(item(),'|')[0]"

For file content add the expression:
"@base64ToBinary(replace(split(item(),'|')[1],'data:image/jpeg;base64,',''))"
"@dataUriToBinary(split(item(),'|')[1])"

The effect is that for each item, split on the character |, and assign the left side as the filename, and base64 decode the right side of the split.
Note: Remember to include the double quotes around the formulas.
image

The last part is adding an action step to create a file in SharePoint. Pick a site and library, and assign the values from the previous compose steps.

image

Setting up the PowerApp

image

For the purpose of this demo I have four controls on in my app. A camera control, a button to send it all to flow, a clear button and a gallery to see the images taken, and which will be sent over to SharePoint.

To grab an image I have the following formula on the OnSelect property of the camera control:

Collect(PictureColl,Camera1.Photo)

This stores each image in a collection named PictureColl.

The gallery control’s “Items” property it bound to the PictureColl collection.

The “OnSelect” property of the submit button contains the following formula:

ForAll(PictureColl,Collect(SubmitData, { filename: Concatenate(Text( Now(), DateTimeFormat.LongDate ),Mid("0123456789ABCDEFGHIJKLMNOPQRTSTIUVWXYZ", 1 + RoundDown(Rand() * 36, 0), 1),Mid("0123456789ABCDEFGHIJKLMNOPQRTSTIUVWXYZ", 1 + RoundDown(Rand() * 36, 0), 1),".jpg"), filebody: Url }));

SaveImages.Run(Concat(SubmitData, filename & "|" & filebody & "#"))


The formula creates random filenames with dates and assigns the filename and image date to a collection named SubmitData (borrowed from Paul’s post). Then the file data is concatenated using a pipe | between the filename and the file contents, and concatenated using a hash # between each image. This is then passed into the SaveImages flow I have added to the PowerApp.

If you run the PowerApp (except in the Windows desktop version), tap the camera a couple of times to grab images, and then hit the submit data, you should end up with some images in your library.

image

See my previous post about on how to add a Flow to the PowerApp using PowerApps studio.