Skip to main content


How to fetch value from Rich Text editor using jquery

When we use multi-line text in SharePoint List, Rich Text Editor will be rendered on List forms. If you ever need to apply a custom validation on this control, you would need to fetch values programmatically.

So how can we fetch value from a rich text editor.

As a first step, open the List form using SharePoint Designer. Replace the control ID (eg., ff1) with a custom name. Let us say Desc.

Every rich text editor is basically a "contenteditable" DIV. We cannot use ID completely. So we need to use wildcard and also use role attribute which is always "textbox" for rich text editor.

So your jQuery code looks like this:


By using role attribute and the field name, you are assured of getting the value of a multi-line text field.
Recent posts

REST API error: The query to field is not valid

I stumbled upon this error when I was trying to fetch items from SharePoint List using REST API.

The query to field 'ExpandColumn/ColumnName' is not valid
After a quick research, I found that we get this error if we are trying to fetch multi-line text column through $expand query.

What does it mean? If you have a lookup column, and if you want to fetch columns through a lookup column, you can use $expand query. Though it works for fields such as Single line of text, Date, Numeric etc, this $expand query will not fetch multi-line text columns.

The workaround for this limitation is you would need to make two REST calls - one to fetch the List items, and the other to fetch corresponding multi-line text value from the lookup list directly.

REST equivalent of AddToCurrentScopeOnly method

When we have to programmatically apply fine grain permissions to the List items, we have to ensure the ACL (Access Control List) limit is under control as defined in Software Boundaries. Typically, in Server side object model (SSOM), Microsoft provides a method called AddToCurrentScopeOnly. The best practice document also suggest to use this method. To quote what is mentioned in the above article:

Use the AddToCurrentScopeOnly method to assign Limited Access membership in a SharePoint group. The key element in this principle is to redesign the architecture so that scope membership does not cause Access Control List (ACL) recalculation at the parent document library and web. In fact, I have used this method in SSOM and it works fine. So when I had to apply fine grain permission to the List items using REST API, I was looking for an endpoint for AddToCurrentScopeOnly. But I could not find any reference in MSDN. It turned out that this method is not available in client side APIs includi…

How to clear multi-value Lookup field using REST API

Last year, I had written a post on updating a multi-value Lookup field using REST API. When you are updating a multi-value lookup column, sometimes you would also need to clear the column.

The way we can clear a multi-value lookup column is different than how we would do for a single value lookup column using REST API.

For a single value lookup column, setting a null clears the value. However, for multi-value lookup column, setting a null or blank space does not work. Why? Remember, when you are updating a multi-value column, you would set an array object with the key "results".

So to clear a multi-value lookup column, we need to assign the key "results" to an empty array as shown below:

{ "ColumnId": { "results": [] } }

So if you are using REST API to update a multi-value column, do ensure to have this use case as well to clear the column.

The year gone by

The year 2017 was very hectic - both in professional and personal lives. I could not contribute much in this SharePoint blog, even though there were a lot of learning.

However, I have made it a point to contribute more in 2018. I just need to do a better planning and execution. Well, at the end of this year, I'll check how far I've been able to contribute to the SharePoint community.

Wish you all a very happy and successful New Year 2018!!!

How to get SharePoint List or Library GUID via REST

Sometimes, you would need List or Library GUID to use that in some operation. In such cases, how do you get hold of GUID using REST API?

There is a straight-forward end point which you can use:


This will return the GUID of a List or Library.

There is also another approach. However this approach works only if a List or Library contains at least one item.


This is a familiar end point which we use to fetch items of a List or Library. To get the GUID from the response, you would do:

var listIDTemp =[0];

var listID = listIDTemp.substring(listIDTemp.lastIndexOf("guid") + 5).split('\'')[0];

As you can see, we are doing string operations to fetch GUID from This contains information only if the response has at least one item.

Difference between Choice and Lookup fields in SharePoint

When you have to provide users an option of selecting a value from a list, you can go for a Choice field or a Lookup field. Have you ever wondered which one to use and when? Which option should be chosen over other? To address these questions, one need to understand the differences between these two data types in SharePoint. This post outlines these differences to help users decide the appropriate column type based on their needs.

FactorChoiceLookupPermissionTo add values to a Choice field, you need minimum Design permissionTo add values to a Lookup field, you need minimum Contribute/Add permissionChanging existing ValuesIf you change a value in a Choice field, it does not affect the existing values. For example, let us say one of the values was NY and there are items with this value. If you change it to New York in the field schema, it only affects the new values. All existing values will retain NY.If you change a value in a Lookup field, all the existing rows reflect the new value,…