Skip to main content

Posts

One of the properties of the Web Part has an incorrect format

I was trying to insert a Content Editor Web Part (CEWP) to a Master Page. I used the recommended route of using Design Manager. Let me share the steps if you are new to this: 1. Navigate to Site Settings 2. Under Look and Feel, click on Design Manager 3. Click on Edit Master Pages and click on perticular Master Page which you would like to edit (before editing, ensure you have a copy of the file for backup) 4. Click on Snippets 5. In the Snippet Gallery, insert CEWP, and set the web part properties 6. Click on Update button 7. Copy the HTML snippet generated and paste it in the Master page (.html file) 8. Upload the [[Master Page]].html file and publish With this approach, you can attach any custom HTML/JavaScript which you would want to execute in all the pages in a site. After publishing the master page, when I refreshed the page, I got the below error: One of the properties of the Web Part has an incorrect format. Microsoft SharePoint Foundation cannot deserialize the ...

Business Connectivity Services - Authentication from the browser

Understanding how BCS works with different types of authentication is not that easy, unless you have an excellent resource which explains in a simple but effective way. I was looking for such resource and I stumbled upon this video. When I watched this 36 minutes video, I was impressed with the way the Presenter has put it across. This video takes SQL Server data source as an example and explains how different kinds of authentication works in BCS such as User's Identity, BDC Identity, Impersonate Windows Identity, and Impersonate Custom Identity. Do watch this video to understand the concepts of authentication from the browser in BCS.   Video Source

Maintaining Multi-line text format in AngularJS View

I was using AngularJS framework in SharePoint site and was trying to fetch data from a List and display using AngularJS view. The List had Multiple Lines of Text column with Rich Text enabled. The HTML markup looked like this: <p>{{description}}</p> Here description contains value from multi-line text field. However, it trims the HTML part and display only plain text. I even tried using ng-bind-html as: <p ng-bind-html="description"></p> This also didn't solve the problem. This is where Angular filter came to the rescue. Solution: First we need to create a filter: var myApp = angular.module('myApp', ['ngSanitize']);  myApp.filter('trusted', function($sce){     return $sce.trustAsHtml; }); Note that, with this filter we are returning the HTML as trusted. Now, this filter should be used in the HTML: <p ng-bind-html="description | trusted"></p> This would keep the format intact...

Multiple Lines of Text column value is blank in SPD Workflow

This is a strange behavior I observed recently. Let's say you have a List with Multiple Lines of Text column. In the column setting, ensure "Append to existing values" is set to No. Now create a SPD workflow on this List and try to access the column value (just log this value to the workflow history list). When you create an item and put some value to this column, you can see the workflow history displaying the correct value. Now the not-so-cool part: Go to column settings, and change "Append to existing values" to Yes. Add a new item to the List. Go to the workflow history. Alas! The value is blank! In the SPD workflow, whether you set return value as "String" or "Plain Text", it always return blank! Summary: If you are dependent on the value of Multiple Lines of Text column in SPD workflow, ensure you have not set "Append to existing values" to Yes.

When Folder is created, Name property is blank

This is a strange behavior I noticed recently and hence thought of sharing through a post. In a Document Library, create a folder. Now for the newly created folder, click on ellipses (three dots) and click "View Properties". Surprisingly, Name property is blank! However, you can still navigate to the folder and upload files to this folder. This seems to be a bug. Now go to "Edit Properties", you can see the value in textbox. Click Save. Again go to "View Properties" and now the Name property is showing the value. I found this behavior when I was trying to create a folder using REST API. Totally surprised with this behavior, finally I posted a question in StackExchange . To my relief, I was not the only one facing this behavior! Hope MS will fix this basic issue soon!

How to get Document Type Icon using MapToIcon REST Endpoint

If you look at a Document Library View, you will also notice Document Type column which shows the icon corresponding to the Document Type. If it is a word document, it shows MS Word symbol as shown below. Document Icon is highlighted There could be scenarios where you would need to display the documents in a custom view and you would also want to make use of these icons. However this is not a very straightforward approach and this post will show you how to get that! I was using REST API to get items from the library. So obviously I was looking at any column which would give me access to these icons. When I got into the columns in the response, the one which caught my attention was the field "DocIcon". But, this field contains only the extension of the document. For example, "docx", "html", "jpg" etc. So DocIcon was of no use as I wanted to get the image URL. I also started looking at any endpoint which would get me this URL. During t...

How to update Person field with multiple values using REST API

Person or Group field in SharePoint is similar to a Lookup field. When you are updating this field using REST API, you need to append "Id" to the name of the column in the body construct. For example, the body construct looks like this: data: { "__metadata": { "type": "SP.Data. ListName ListItem" }, "Title": "First Item", " PeopleField Id": "4" }; The highlighted portions should be replaced by the actual List Name and Column Name. In the above example, the REST call is updating a List item with Title and People columns. How to get the value for user ID ("4" in the above example) needs a separate explanation and that will be my next post! The above example works fine if Person field is configured to accept only one value. If we change the Person field to accept multiple values, how do we pass more than one value in the REST call? Since we normally separate user names with semicolon in peop...