Tag Archives: Phillips

Saving Tweets to Excel using Microsoft Flow

Microsoft Flow is the new tool integrated with Office 365 which allows different services to interact. Such as social media providers like Twitter and Facebook or file sharing platforms like Dropbox, OneDrive and Google Drive, and many more services.

I wrote a blog post earlier this year about integrating machine learning tools and another post about syncing Google calendar data into SharePoint using Flow processes, but I thought I would get back to basics and provide a clear easy tutorial for Microsoft Flow newcomers.

In this example, I’m going to setup a Flow to put all the tweets made from the company (my) twitter account into an excel spreadsheet. This is a simple process but might be useful for keeping track of marketing or even leaving an audit trail of marketing activity by the social media owners within an organisation. The excel spreadsheet will sit in OneDrive for business but you can determine where you would like it stored.

To start, we are going to create a new excel spreadsheet with a table. In OneDrive for business, create a new excel spreadsheet called “tweets”.

Microsoft Excel Online

Add the following column headers:

  • Tweet Text
  • Location
  • Time

Select the column headers and in the insert menu, select “table”. This will make a new table in Excel which Flow can access to add rows.

Open Microsoft Flow. The Flow icon should be available in your Office 365 App Launcher if you have the licence enabled (alternatively you can just go to the website).

Search the templates for “Twitter”, and select the “Save tweets to an Excel file” template.

Microsoft Flow Templates

You will then be required to login to Twitter and Excel. When logging into Excel, make sure that you sign into OneDrive for Business with the correct account (otherwise you will get unauthorised access when trying to add rows). When both services are signed in, press continue.

Twitter trigger

In the twitter trigger, add the twitter account name to the search text box. This will fire off the process when that account tweets.

Excel action

In the insert row action, find the tweets excel spreadsheet in your OneDrive for Business by using the folder icon. The table will appear automatically under the Table name drop down. You can then select each column and add the appropriate tweet field.

Save the Flow and check that it is enabled.

In twitter, send a tweet from your account.

Twitter tweet

The Flow will run every 60 seconds, you can check the runs by clicking on the “i” icon next to the Flow and then filtering by “Checks (no data)”. After a couple of minutes, your spreadsheet should be updated with the tweet data!

Excel populated with tweets from MS Flow



How to setup a class in Microsoft Classroom

In the video below, I go through the simple steps of setting up a class in Microsoft Classroom. It’s straightforward but does require teachers to manually setup and keep class membership up-to-date. Third party integration to MIS databases will be available soon in the UK (hopefully). In the meantime you can use a similar assignment system called Teacher Dashboard which has the option of syncing AD and Office 365 groups.

Microsoft Classroom is a great out-of-the-box product but doesn’t allow much customisation so you may want to think about some custom class and subject sites as part of your portal. Please feel free to contact us for a demo of these at Cloud Design Box.



Issues with the new SharePoint interface for document and picture libraries

Let’s start with the positive aspects of this new interface. It’s responsive and integrates really well into the OneDrive app for mobile devices. However there are currently a number of setbacks for users when switching to the new look interface. Users should consider it carefully before turning the new interface on at tenancy level or on a per user basis.

New Document and Picture Library

No JS Link property

Microsoft have mentioned that there is still some functionality to roll out, however they have not been specific about what that will include. A large number of businesses use JS Link to highlight data in a list or library and to add some custom actions at the item level. This is done using the Microsoft best practices of using client side JavaScript, however we are still awaiting this functionality in the new interface. New features are being added to the new interface such as content types and custom columns so we can only hope that this will also be added before the full implementation of the new interface in 2017.

No JS actions to brand the interface

A while ago I blogged about using JS instead of custom master pages to brand the look and feel. Again this is client side code and was Microsoft best practice, however this doesn’t seem to apply to the new view. The new look interface despite being modern and minimalist is bland and unbranded. Most companies/schools want branded intranets, they are always keen to get away from the “SharePoint” look. Although the new interface is modern and responsive, all of the pages look the same and it is possible that we will fall into the trap of looking like SharePoint again. Theming engines do not offer the bespoke customisation that most users require. The future of SharePoint event and videos did mention a chrome as part of the SharePoint framework so we can only hope that this is exposed to JS developers.

No image link in picture libraries

On occasions users require a link to a document or image inside a library. This used to be easy for users to do, open it up and copy the URL. This is no longer possible for an image library as each image opens up in a lightbox view. There are no options to get a link to the exact image, in fact there is an option called “get a link” but this shares the image and changes the permissions rather than giving a URL link (for users to use on a site or email).

These are the initial issues I have found with the new look interface. It seems to be have been rushed out to tenancies without investigation into how customers use library views within SharePoint. Although there is a benefit having a similar interface to OneDrive and having it work as a single page application, the fact that it is part of a SharePoint site and has that extra SharePoint functionality makes it usable to end users. The new views will run side by side until 2017, hopefully by then Microsoft will have resolved the issues and released the new SharePoint framework for Microsoft partners (due to go live in autumn 2016) to get developing branding and custom JS solutions.

UPDATE: 08/07/2016

Microsoft have released this update confirming that there is still functionality to be added to the new user experience. Looks very positive for JS links and other missing functionality: http://dev.office.com/blogs/update-on-modern-document-libraries-and-extensiblity

Deleting all navigation nodes using CSOM PowerShell

It’s fairly straightforward to enumerate nodes in an array, in this example I’m deleting all the top navigation menu nodes in a SharePoint site. This is how I would normally loop through the top navigation menu:

$topNav = $context.Web.Navigation.TopNavigationBar;
$context.Load($topNav);
foreach ($topNavItem in $topNav)
{
	Write-Host $topNavItem.Title
}

However if I want to loop through the menu and delete all the nodes, the above function errors as the array has changed each time it loops, the method below works but doesn’t catch all the menu items.

for ($ii = 0; $ii -lt $topNodes.Count; $ii++)
{
	Write-Host $topNodes[$ii].Title 
	$topNodes[$ii].deleteObject();
	$context.ExecuteQuery();
}

As we are enumerating the nodes, we are removing nodes from the start and changing the position of the other nodes in the array. As the loop continues to run, it can skip positions of some of the nodes.

A solution which works better is looping through the array backwards. As you loop through the array backwards, it doesn’t change the position of items still in the array.

for ($ii = $topNodes.Count - 1; $ii -ge 0; $ii--)
{
	Write-Host $topNodes[$ii].Title 
	$topNodes[$ii].deleteObject();
	$context.ExecuteQuery();
}

Hope you may find this useful, it can be difficult to find why the loop misses some random items and hopefully looping backwards will avoid any issues like this.

Using the SharePoint recycle bin

I’m often asked about restoring deleted documents, where the recycle bins are and how long they are kept there for. Hope this post will be of use to some of you.

SharePoint’s powerful document management features provide the end user and administrator ways of recovering deleted items. Items can be deleted accidentally (sometimes without the end user even knowing). Luckily we can go into SharePoint and recover the document before it is lost forever.

Two stage recovery

When a document is first deleted, it goes into the end user recycle bin on the site. The user deleting the item has several days (93 days by default in SharePoint Online) to recover the item themselves.

After that period (or if the item is deleted from the site recycle bin) it then goes into the second-stage recycle bin. The second-stage recycle bin is only accessible by the site collection administrator. There is then another 93 days to recover the item before it is deleted forever! Items in the second-stage recycle bin don’t count towards your site collection quota but items will automatically be deleted if you exceed 200% of your site collection quota (which is unlikely if you make sure your site collection has 1TB of storage).

I’ve created the video below to explain the recovery process from both recycle bins. A great way to find those missing documents which were accidentally deleted by the end user.



More information can be found here on the Microsoft website.

Setting up Azure Connect (DirSync) for Office 365

I’ve made a quick video guide on how to set-up Azure Connect (DirSync) to sync with Office 365. It’s done using a simple demo environment and I suspect that you may find complications and other errors when trying this out in a production live environment. Hopefully this is of use to you (even if it just makes it seem less scary!). I will try to get chance to write up this blog post in more detail rather than just the video at some point in the future.



Using PowerShell to find last DirSync

When troubleshooting DirSync issues with Office 365, it is sometimes difficult to know if the DirSync successfully applied to Office 365.

There is a quick way to check this and it provides the data for when the update last took place. First you will need to make sure that you have installed the Azure AD Module for PowerShell, you can download from here.

When this has installed, run Connect-MsolService to connect to the Office 365 tenancy, this should be a global administrator account.

Azure Connect PowerShell

Then run Get-MsolCompanyInformation to get the tenancy information which includes the last dirsync time and last password sync



How to embed a Twitter widget on a SharePoint page

Many schools and businesses are using twitter as a social communication platform to send out news and information to users. How to embed twitter feeds on SharePoint intranets and public sites has been a popular question recently so thought I would share with you how it is done. I’ve also created a video guide on YouTube to talk through the process.

First login to your twitter account in a browser on a desktop computer (it doesn’t have to be the same account as the one that you want to display in your widget).

Click on your profile picture in the top right of the screen and select “Settings” from the drop down menu.

Twitter

Select “Widgets” from the left side menu.

Twitter

Create a new widget.

Twitter

Choose your design and configuration. More options are available via the customisation documentation link on the page. Click “Create Widget” to generate the code.

Twitter

Copy and paste the code into a Script Editor web part. The Script Editor web part can be found under the “Media and Content” category.

Twitter

I go through the process in more detail in the video below. Hope you find it useful. For SharePoint support and consultancy please contact me at Cloud Design Box.



How to render display template on a list view

This blog post is a bit more technical than my previous entries. Just recently, I was required to show two different views of a list on the same page (both styled with JS Display Templates). It’s relatively straight forward when you know how to quickly get the view GUID from the web part.

JS Display template only applying to one web part

You may have seen in other posts that you can get the GUID of a view by going to the edit view page and grabbing it from the URL encoded string. However this doesn’t always work for web parts added to the page as they tend to get thier own unique “current view”.

There is a really easy and quick way of finding this GUID using an alert in your JavaScript Display Template. When you are working with the current list object, in my example below “ctx”, you can get the view GUID from this object by calling “ctx.view”. Wrap that up in an alert and the alerts will render from top to bottom on the page and display each web part view GUID.

alert(ctx.view);

Once you have the GUID, use another if statement in your code to set the base view id. Now your JavaScript only applies to that one view for the list.

if (ctx.view === "{07BC665B-0274-42D2-97BF-8EBEA8B72436}") {
	//Override the BaseViewID if it's the one we want.
	ctx.BaseViewID = 722;                
}