Monday, 12 February 2018

How To Embed Slack On A SharePoint Page

This isn't going to be my cleanest blog post or code...

  • Here's where you go to get the URL for the 'Get Messages' section of the code:
  • Here's where you go to get the URL for the 'Get User' section of the code:
  • CompanyName is the name you signed up for in your Slack URL

The rest you should be able to paste into a Script Editor web part


<link rel="stylesheet" type="text/css" href="">
<link rel="stylesheet" type="text/css" href="">
<link rel="stylesheet" type="text/css" href="">
<link rel="stylesheet" type="text/css" href="">
<link rel="stylesheet" type="text/css" href="">
<script src=""></script>

<div id="SlackFeed"></div>

//Get User
$.ajax({ url: "[InsertToken]&user=[InsertUser]&pretty=1" }).then(function (data) {  
if (data["ok"] && data["ok"] === true) {
UserInfo = data["user"]; 

//Get Messages
$.ajax({ url: "[InsertToken]&channel=[InsertChannel&count=10&pretty=1" }).then(function (data) {
if (data["ok"] && data["ok"] === true) {
slackMessages = data["messages"];       
$.each( slackMessages, function( key, value ) {
$("#SlackFeed").append('<div class="message" style="overflow:hidden;width:300px;">' + 
'<div class="message_pic" style="float:left;">' + '<a href="https://[CompanyName]'+'" target="https://[CompanyName]'+ +'"><img src="'+UserInfo.profile.image_48+'"/> </a>' + '</div>' + 
'<div class="message_text" style="float:left;padding-left:5px;width:200px;">' + '<span class="message_body"><b>'+ UserInfo.real_name +'</b></span><br/>' + '<span class="message_body">'+ value.text +'</span>' + '</div></div>');    
}); } });       

Thursday, 7 December 2017

Nintex Workflow for O365 - Get Manager Email Address

Nintex Workflow in Office 365 is different from On-Premise, so here's how you can grab a manager's email address.

If you want to assign a task or email the manager of the person who submitted an item.

Click in the Text Box you would like to add the email address to and using the right-hand navigation menu select Workflow Context > Manager Email Address


Office 365 - How to Link Directly To A Users Delve Profile With Email Address

You've probably seen it before, when you navigate to a persons Delve profile in Office 365, the URL contains a unique UserID.


Well there is a way to create a link that will send you to a users Delve profile based on their email address

You may want to programatically show a list of users and link to their Delve Profiles.

The link below allows you to input an email address at the end, Office 365 will automatically translate this and re-direct you to the Users Profile


Monday, 13 November 2017

PowerApps - Default SharePoint People Picker Field To Be Logged In User

When you're building a PowerApp connected to a SharePoint List Form and you would like to capture the details of the person who is filling out the form.

I understand that this is already captured via the 'Created By' SharePoint System field, but sometimes customers like to capture requestor name, phone, etc on the form itself rather than having to go to SharePoint to view it all.

  • You've already created a PowerApp and added a 'Form' Control that uses a SharePoint List as a Data Source.
  • Your SharePoint List contains a People Picker Field
  • To pull back details about users, add another Data Source: View  Tab > Data Sources > Add Data Source > Office 365 Users
  • Click on the Card in the form that contains your People Picker Field
  • Go To Advanced and click 'Unlock to change properties' so that you can select the field itself
  • Click on the People Picker Field itself, then select the 'Default' function and type Office365Users.MyProfile()

Now when you open up the PowerApp it should automatically populate the People Picker field with the user who is logged in.

You can use the same concept to auto-populate other fields inside your form with specific user details.  For more info check out this Microsoft article explaining the Office 365 User Data Source:

Friday, 6 October 2017

Deleting an Office 365 Group Deletes your Yammer Group

Even if the Yammer Group was created first... So yeah, don't delete O365 Groups unless you want everything gone.

If you need to recover:

##Do this off Network with regular powershell opened as Administrator

Import-Module AzureADPreview


Get-AzureADMSDeletedGroup | Out-GridView

Restore-AzureADMSDeletedDirectoryObject –Id xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Get-AzureADGroup –ObjectId xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Update - 08/12/2017
Microsoft are rolling this restore functionality into Exchange Online over the next month or two, so you wont need the script above soon:

Friday, 1 September 2017

SharePoint Online - Share or Copy Link Button Defaulting to 'GuestAccess' Link

Ever tried to copy or share a link in SharePoint Online and it defaults to providing you with a Guest Link that is 'accessible to anyone in the organization'?

It's a really good option for staff that want to quickly share a document without having to understand SharePoint Permissions.

Unfortunately, the Guest Access Link forces the user to open up the document In-Browser using Office Online.  I personally can't abide this until the functionality between Online & Client are 1-to-1.

How to Fix
SharePoint Online defaults the Sharing settings for copying & sharing links to "Internal - People in the Organization Only' , which basically means 'Guest Link that opens in browser'.

To change this you just need to go to:

  • SharePoint Administration Center
  • Sharing Tab
  • Change the 'Default Link Type' setting from 'Internal' to 'Direct - Only people who have permission'
  • Done!  No more links with 'guestaccess.aspx' in them.

Thursday, 27 July 2017

SharePoint Online - Hide External Users from Global Search Results

Had a problem where external users (people outside our organisation who had been provided with an anonymous link to OneDrive/SharePoint Documents) were showing up in SharePoint's People Search Results.

This article explains how to fix:

Basically you need to add a Query Rule to SharePoint's 'Local People Results' Search Query to block out results that contain the external users.

I personally filtered out all results where a persons Username contained '#EXT#', which is what gets appended in Office 365 whenever an external user is given access to a document.