Pages

Wednesday, December 28, 2016

Save my email attachments to a SharePoint document library using Microsoft Flow

Introduction

I was trying Microsoft Flow and I thought of sharing how I did my first Flow App using the template provided by Microsoft.

The template I’m using is “Save email attachments to a SharePoint document library”.

Steps

Step 01

Go to https://flow.microsoft.com/en-us/ and find the “Save email attachments to a SharePoint document library” using the search box or by navigating through all template.

MicrosoftFlow1

Step 02

Click on the app and you will get a screen as below. Then you have to select “Use this template” option.

MicrosoftFlow1 (1)

Step 03

Click Sign In and then use your Office 365 username and password.

MicrosoftFlow1 (2)

Step 04

The template will be created for you as below.

MicrosoftFlow1 (3)

 

Step 05

Select Inbox for the folder option. You can select the Inbox by clicking on folder icon.

MicrosoftFlow1 (4)

 

Step 06

Site URL: Provide the SharePoint site URL

Folder Path: Give the name of the document library where you would like to store the attachments.

File name: You can give any dynamic value or static value. Please note that you can’t store two documents in the same name. So please make sure the name is dynamic.

File Content: Select “Content”

MicrosoftFlow1 (5)

Step 07

Click on “Create Flow” from the top.

MicrosoftFlow1 (6)

Conclusion

Send a mail with attachment and check your SharePoint Document library. There you can find the attachments.

image

Tuesday, November 1, 2016

Usage of HTML field security in SharePoint Online and SharePoint 2013

Introduction

HTML field security in SharePoint (Office 365 and SharePoint 2013) controls inserting iframes on the pages of the particular site.

You can go to HTML Field Security by going to Setting Page and under “Site Collection Administration” you can find “HTML Field Security” option.

1

You can edit the page and select “Edit Source” from the ribbon in order to add iframe into a page.
3
Options

There are three options
2

Option 1. Do not permit contributors to insert iframes from external domains into pages on this site.

This blocks the contributors from adding iframes from external domains. When the users try to add an iframe through edit form they will get a notification saying “Warning: Some of your markup was stripped out. Try using the Embed command.
4
Option 2. Permit contributors to insert iframes from any external domain into pages on this site.
This option will lead the contributors to add iframes from any domain.
Option 3. Permit contributors to insert iframes from the following list of external domains into pages on this site: Allow iframes from this domain:
The contributors can add iframes from the domain given in the area. And also the subdomains of the given domain are trusted.

So this is how we use the HTML field security in SharePoint. But again let’s discuss some scenarios on HTML field security.

Scenario 01.

In the setting, Option 1 is selected and can I add an iframe to the page?

Yes you can. Add the iframe through “Script Editor” web part. Edit the page, go to insert and click “Embed Code”.
4
Scenario 02.

What will happen to the exiting iframes if the Option is set to 3?
Nothing will happen to the exiting iframes. It will continue to work.

Scenario 03.

What will happen to sub sites?

The setting in the site collection level will be applied to sub sites as well.

Friday, October 14, 2016

Auditing in Office 365 Sites

Introduction

The audit feature in SharePoint helps you track user activities. It tells you Whochanged What, When and Where.

Providing accurate information and keeping it accurate is critical to any business. Tracking user activity and ensuring data changes are audited is important so that when mistakes happen you can quickly fix them. In most business scenarios, Auditing is a critical business requirement.

In Offcie 365, The SharePoint Online environment provides you with 3 primary configuration options for audit at the Site collection level:

  1. Audit Log Trimming
  2. Audit settings for Documents and Items
  3. Audit settings for Lists, Libraries and Sites

Audit Log Trimming

The Audit Log Trimming settings Allow you to specify whether you want to automatically trim the audit log for the current site collection. Audit log trimming might be worthwhile if you have a very active site and are concerned about the size of the log.

Optionally specify the number of days to retain:

  • The number of days to store the audit report.

Also you can select the location to store the audit report.

The audit log captures the following information for the events that are selected to be audited.

Documents and Items Level

  • Editing items
  • Checking out or checking in items
  • Moving or copying items to another location in the site
  • Deleting or restoring items

Lists, Libraries, and Sites

  • Editing content types and columns
  • Searching site content
  • Editing users and permissions

How to Configure audit settings for a site collection?

  • Go to Site Setting on the root site collection
  • On the Site Settings page, under Site Collection Administration, select Site collection audit settings.
  • On the Configure Audit Settings page, in the Audit Log Trimming section, set Automatically trim the audit log for this site? to Yes.
  • Optionally, specify the number of days of audit log data to retain.
  • You can also specify the document library to save audit reports to before the audit log is trimmed.

How to View Audit reports?

The events you selected are captured in the audit reports. You can export the report on Microsoft Excel 2013 format and can be accessed from the Auditing Reports page.

  1. Go to  Site Settings page
  2. Under Site Collection Administration, Select Audit log reports
  3. From here, you can run the available Content Activity Reports, Information Management Policy Reports, Security and Site Settings Reports or create Custom Reports.

Give this a try and see it for yourself.

Friday, September 9, 2016

"Your domain doesn't match the expected domain for this app deployment." issue in provider hosted add-in

Problem

One of my friend had an issue after deploying his provider hosted add-in in SharePoint on premise environment. He was not able to access list data from the add-in web of the Add-in. I looked at the code and the error was something as below.

provider

Solution

Step 01

Get the add-in id by navigating to

http://<SharePointWebsite>/_layouts/15/AppPrincipals.aspx

App identifier was something like the below and the text which was bolded will be the add-in id.

i:0i.t|ms.sp.ext|21ed123y-b1u9-4d54-9cb1-ee36b5f91304@9d2c9af1-aa54-42rf-ab8d-37d639b3f6ed

Step 02

Get the App Domain by going to below url and giving the add-in id which we got from the above.

http://<SharePointWebsite>/_layouts/15/AppInv.aspx

Step 03

My observation was that the App Domain which was given during registering the add-in was different from the url where the add-in has been hosted.

So, I registered the add-in again in the SharePoint site with the correct IIS host header and redeployed the add-in; which lead to work perfectly.

References

https://msdn.microsoft.com/en-us/library/office/jj687469.aspx

Friday, August 26, 2016

No permission to open O365 SharePoint site in SharePoint Designer

Problem

I tried to open a SharePoint Online developer site in SharePoint designer. Unfortunately I got an unauthorized error (403 Forbidden as given in the screen shots below).

020301

Solution

Go to Account setting on the left pane and check whether your user information is correct. Once you sing in with correct credentials you can log in to your site.

0405

Tuesday, February 23, 2016

Facebook template is not found in Visual Studio 2015

Problem Background

Today I thought of creating a Facebook app using Facebook template which was available in Visual Studio 2013. Shockingly the template was not available once I select ASP.Net Web Application template and click OK (Screen shot attached).

1

Solution

Then I got to know by searching online that there is a new extension has been released for ASP.Net project templates.

Check out the below link and install the Visual Studio 2015 Extension for ASP.NET Project Templates.

https://blogs.msdn.microsoft.com/webdev/2015/02/08/introducing-the-visual-studio-2015-extension-for-asp-net-project-templates/

PS: I directly downloaded the extension from the below url and installed it.

https://visualstudiogallery.msdn.microsoft.com/9402d38e-2a85-434e-8d6a-8fc075068a42

2

Thursday, February 11, 2016

Sri Lanka SharePoint Forum - Monthly gathering (January)

Joel Oleson and Michael Noel were our special speakers for Sri Lanka SharePoint Forum Monthly gathering for the month of January. 

12510357_10153659913422530_2219245561543803648_n


We would like to thank the speakers, attendees and all the sponsors.

I’m also privileged to receive Microsoft Devices from Totalamber as gift for the meetup. 

12716084_997338653674303_825077823129639774_o


Couple of photos from the day.


12522950_10153667635812530_7712577680192952576_n12540786_10153667635747530_1889572300362793346_n

12508989_10208103433524695_5401919268181960161_n

Wednesday, January 20, 2016

Enable CORS for web API 2 through Azure portal

Introduction

We can enable Cross-Origin Request (CORS) by adding “Microsoft ASP.Net Cross Origin Support” nuget package. Also we can enable CORS thorough Azure portal if we have deployed our web API 2 in azure as a app service.

Enable CORS for web API 2 through Azure portal
  1. Login to your azure portal through a browser
  2. Go to app services and click on you app service where web api 2 is hosted.
  3. Go to setting page and scroll thorough
  4. You will find API section and under that you will find CORS (I have highlighted in yellow)

cors1

  1. Click on CORS and you can add one or more your client apps. Also you can * mark to grant access to all client applications.
cors2

Tuesday, January 19, 2016

Cannot open server “” requested by the login. Client with IP address “” is not allowed to access the server issue in Azure SQL Database

Problem

I created a windows forms application in my local machine and the database was deployed in Azure. Once I try to access the database from my local machine through the application I got the exception “Cannot open server “” requested by the login. Client with IP address “” is not allowed to access the server issue”. See the screenshot.
1

Solution

Step 1. Login to Azure portal and select your database. I have used the new Azure Portal.
Step 2. Select tools on from top menu.
image
Step 3. Once you select Tools the window will be expanded and will show “Open in Visual Studio”. Select it.
image
Step 4. Then click on Configure your firewall.
image
Step 5. Give any rule name and you can give your IP address range. Note that the Client IP address is your own IP address. You can set the rage using the client IP address shown in the portal.