Image for post
Image for post
Photo by Alice Donovan Rouse on Unsplash

Intro

Let’s see how to automatically classify an image uploaded to the SharePoint library. We will add tags and descriptions as metadata to any image which is getting uploaded to the SharePoint library using one of the Microsoft Cognitive Services, Computer Vision API. It will analyze the image and provide us a full-sentence description of the image, and generate tags related to the objects in the image.

For events handling we will be using Microsoft Flow, which will be triggered on file upload or modify and invoke the Vision API to get the caption and tags and then store this information like tags and description properties of the image in SharePoint. …


Image for post
Image for post

QnAMaker is a cloud API service offered by Microsoft Azure Cognitive Services, which enables you to create a knowledge base(KB) from your existing content such as FAQs, manuals, documents and other questions and answers.

After knowledge base creation and training, then the service will be able to answer to users’ questions in natural language by matching for best possible answers (by ranking) from the KB. The common scenario is to connect this QnAMaker service to conversational bots and provide answers to users questions through dialog.


In Game of Thrones, season #8 episode #4 Starbuck coffee cup played a cameo role in the post war feast. I was wondering how someone spotted this, when you are immersed in the episode itself. It’s no longer available in streaming services, HBO has removed it silently. On other hand I was thinking whether an AI pre-built models like Vision APIs can detect the coffee cup in the frame? Let’s test it out.

Why I’m doing this? this is only for fun and not to evaluate or to compare any of these services. I’ll be using Microsoft Cognitive Services Vision API, Google Vision AI API and Clarifai Predict API. I’m not going to train any of these models and will be using only their demo feature. Not able to find demo of Amazon’s Rekognition API, so that’ll be missing in this post. …


Image for post
Image for post

You have created a modern team site, and now you are thinking about adding a custom or default webpart then this post should be helpful. Think about something like adding a site contact while provisioning the modern site. Thanks to PnP PowerShell Cmdlets again, for making our life easy. I’ll be using Add-PnPClientSideWebPart command.

I’m updating the home page by adding default people webpart, and configuring it to show in section 1 and in column 2.

This is how it looks after you run the below script.


Image for post
Image for post
[Photo by Luca Bravo on Unsplash]

It has become a kind of tradition for me to write this component to export selected items to excel, whenever there is a new model or approach of development in SharePoint. It all started with the SharePoint 2007 version. Here is the list of components for various versions and development models.

SharePoint 2007/2010/2013/2016Full trust code component can be found here.

SharePoint 2013/2016/Online Provider hosted addin — NodeJS based for classic list.
SharePoint Online — SPFx based list view extension for modern list

Exports selected items to excel spreadsheet in XLSX format, with the columns from the current modern list view. This Listview extension utilizes SheetJS XLSX to create a spreadsheet in XLSX format with the items selected from the view. …


Image for post
Image for post

If you are into SharePoint development, then you should be familiar with your best friend _spPageContextInfo which gives you more valuable context-based information. You can also access the same now from SharePoint Framework too.

// This is how you can access the page context info
this.context.pageContext.legacyPageContext;
// Retreive current user display name this.context.pageContext.legacyPageContext[‘userDisplayName’]);// Even site classification
this.context.pageContext.legacyPageContext[‘siteClassification’]);

Below is the complete list of object’s properties which sample values,

CorrelationId : "b215479e-f056-5000-11a1-ec000000000010" 
DesignPackageId : "00000000-0000-0000-0000-000000000000"
PreviewFeaturesEnabled: true
PublishingFeatureOn : false
ReycleBinItemCount : -1
aadInstanceUrl : "https://login.windows.net"
aadTenantId : "96d8e75d--14a031e2320f"
aadUserId : "e7d71f70-13e9-0000-0000-86d1269cd536"
alertsEnabled : true
allowSilverlightPrompt : "True"
blockDownloadsExperienceEnabled : false
canUserCreateMicrosoftForm : true
canUserCreateVisioDrawing : true
cdnPrefix : "static.sharepointonline.com/bld"
crossDomainPhotosEnabled : true
currentCultureLCID : 1033
currentCultureName : "en-US"
currentLanguage : 1033
currentUICultureName : "en-US"
departmentId : null
disableAppViews : false
disableFlows : false
env : "prod"
farmLabel : "US_9_Content"
fid : 16190
formDigestTimeoutSeconds : 1800
groupColor : "#188387"
groupHasHomepage : true
groupHasQuickLaunchConversationsLink : false
groupId : "c771d35a-fee4-4447-9c0a-6c0b199d00fc"
groupType : "Private"
guestsEnabled : false
hasManageWebPermissions : true
hasPendingWebTemplateExtension : false
hideSyncButtonOnODB : false
hubSiteId : null
idleSessionSignOutEnabled : false
isAnonymousGuestUser : false
isAppWeb : false
isEmailAuthenticationGuestUser : false
isExternalGuestUser : false
isHubSite : false
isMultiGeoTenant : false
isNoScriptEnabled : true
isSPO : true
isSiteAdmin : true
isTenantDevSite : false
isWebWelcomePage : false
layoutsUrl: "_layouts/15"
listBaseTemplate : 100
listId : "{7069a902-4347-000-8a03-00fceecfdc70}"
listPermsMask : {High: 2147483647, Low: 4294705151}
listTitle : "Property Locations"
listUrl : "/sites/DemoModernTeamSite/Lists/Property Locations"
maximumFileSize : 15360
msGraphEndpointUrl : "graph.microsoft.com"
navigationInfo : {quickLaunch: Array(14), topNav: Array(2)}
nid : 107
openInClient : false
pageItemId : -1
pageListId : "{7069a902-0000-4000-8a03-21fceecfdc70}"
pagePermsMask : null
pagePersonalizationScope : 1
preferUserTimeZone : false
readOnlyState : null
serverRedirectedUrl : null
serverRequestPath : "/sites/DemoModernTeamSite/Lists/Property Locations/AllItems.aspx"
serverTime : "2018-02-04T04:58:48.0656761Z"
showNGSCDialogForSyncOnODB : false
howNGSCDialogForSyncOnTS : true
siteAbsoluteUrl : "https://constoso.sharepoint.com/sites/DemoModernTeamSite"
siteClassification : ""
siteClientTag : "0$$16.0.7324.1203"
siteColor : "#188387"
siteId : "{1c2e6438-80d2-40cc-9bc5-5aa657c00000}"
sitePagesEnabled : true
siteServerRelativeUrl : "/sites/DemoModernTeamSite"
siteSubscriptionId : "0f6d0000-f22c-47d7-a17f-cd78e6b74a54"
supportPercentStorePath : true
supportPoundStorePath : true
systemUserKey : "i:0h.f|membership|10030000000003d@live.com"
tenantAppVersion : "3704586950"
themeCacheToken : "/sites/DemoModernTeamSite:/sites/DemoModernTeamSite/_catalogs/theme/Themed/6FE0689A:9:16.0.7324.1203"
themedCssFolderUrl : "/sites/DemoModernTeamSite/_catalogs/theme/Themed/6FE0689A"
themedImageFileNames : {spcommon.png: "spcommon-B35BB0A9.themedpng?ctag=9",
ellipsis.11x11x32.png: "ellipsis.11x11x32-2F01F47D.themedpng?ctag=9",
O365BrandSuite.95x30x32.png: "O365BrandSuite.95x30x32-C212E2FD.themedpng?ctag=9",
socialcommon.png: "socialcommon-6F3394A9.themedpng?ctag=9",
spnav.png: "spnav-230C537D.themedpng?ctag=9", …}
userDisplayName : "Rajesh Sitaraman"
userEmail : "rajesh.sitaraman@contoso.com"
userFirstDayOfWeek : null
userId : 3
userLoginName : "rajesh.sitaraman@contoso.com"
userTime24 : false
userTimeZoneData : null
viewId : "{7edde8c2-5458-42b4-0000-883094b3837e}"
viewOnlyExperienceEnabled : false
webAbsoluteUrl : "https://contoso.sharepoint.com/sites/DemoModernTeamSite"
webDescription : "Demo Modern Team Site"
webFirstDayOfWeek : 0
webId : "{8985f800-0000-42f2-899a-abb9f24251e3}"
webLanguage : 1033
webLogoUrl : "/sites/DemoModernTeamSite/_api/GroupService/GetGroupImage? …


Image for post
Image for post

Here are my five points why I use the classic library experience even in a modern team site, or the site provisioned with office 365 groups.

1. Required columns are not required

All the time we were evangelizing the use of the meta data and tagging the documents, in the modern experience the required fields are not mandatory. Check-in form is not shown to the user after the document is uploaded, so its user’s discretion to use information panel to enter the required fields. Also the document is not marked in any way to notify the user that its missing required column or content type. …


Image for post
Image for post

I’m vivid user of modern teams sites, modern pages and started strongly recommending our clients to use Office 365 groups and modern team sites. I was also looking for some options to reduce the header banner. I came across Mikael Svenson’s nifty #SPFx header configurator WebPart to configure header size.

This approach uses the SharePoint framework and performs CSS injection to override the header size but this not a recommended approach, for more details read Mikael’s dont’ do it approach 😃 . Is there any alternative? whenever you provision the modern team site, you would have noticed that the default home page does not have the fat banner. So the workaround is, instead of creating the new modern site page go to the site pages library and make a copy of home.aspx and rename it as desired. This page does not show the page title, so you need to edit the page and add text webpart with the title. …


Let’s create a simple flow for the common scenario we encounter, send a notification on a certain date or wait till some date and perform an action. In SharePoint designer workflow, we use the “Pause until” step to perform this. Similarly in Microsoft flow we will use the action “Delay Until”.

Image for post
Image for post

Look at the below flow, we have action trigger whenever an item is created in the SharePoint list we will trigger the flow. Make sure to login with your Office 365 account when prompted. Provide the site url and then select the list for which you want to trigger the flow. Next, add the delay until action and then use the date field which will the date till we need to pause the flow. Why do we have the Z after the due date, it might be weird but flow won’t treat it as date in UTC format if we don’t add one. As a next step we have “Send Email” action to send email after the delay period. …

About

Rajesh Sitaraman

former @microsoft MVP | architect @corebts | @cricket fan

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store