Unable to see more than 100 Items from SharePoint list using Rest API

Leave a comment

In your custom list which is having more than 500 records. When you query with REST API it returns only 100 records.

Eg: http://<domain>/<site url>/_api/web/lists/GetByTitle(‘ListName’)/items

To override that you need to append $top=3000 or $top=5000

Eg: http://<domain>/<site url>/_api/web/lists/GetByTitle(‘ListName’)/items?$select=AuthorId&$top=3000

Here authorId is CreatedBy Column.

Feel free to email me at bharath.chennu@onetidbit.com



How to identify sharepoint 2013 controls with javascript in a sharepoint newform.aspx and clear them

Leave a comment

Textbox with ID
Choice field with ID
DateTime with ID

but differs for Metadata field and Enhanced rich textbox

Metadata field will vary since its an array

var myMetadataField = jQuery(‘div[Title=”Title of the field”]’).find(‘div [role=”textbox”]’);

Enhanced Rich textbox

var RichTTB=jQuery(‘div[id=”Rich_x0020_description_d7e728f9-1cc7-497a-8c6b- e7ec68ee9f97_$TextField_topDiv”]’).find(‘div[role=”textbox”]’);

People picker field

var spclientPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[“_x0066_md4_62a2c22c-557e-4650-9454-cb293b0f44aa_$ClientPeoplePicker”];
if (spclientPeoplePicker) {
var ResolvedUsers = jQuery(document.getElementById(spclientPeoplePicker.ResolvedListElementId)).find(“span[class=’sp-peoplepicker-userSpan’]”);
jQuery(ResolvedUsers).each(function (index) {


Get Users and update new user in People field of a particular List Item in Sharepoint 2013

Leave a comment

1) Use REST API url to get the users in people field
2) Write a function where we use ajax to get the data and declare an array and push the existing data along with user you want to add and at last update the listitem column People field.

You can write the code in a button click of a javascript.


<input id=”btnUTSubmit” type=”submit” value=”submit” onclick=”insertToList();” style=”text-align: center;width: 100px;margin: 0 auto;display: block;”>

Name of the function is: insertToList() and name of list is DOCS and columnname is SchoolUsers

function insertToList() {
var clientContext=SP.ClientContext.get_current();
//Let’s say here item id will be there in URL. We will get it by getting Querystring

// <siteurl>?pdfID=2
var urlForAllItems =”/_api/web/lists/getbytitle(‘DOCS’)/items(“+itemId+”)?$select=SchoolUsers/Title&$expand=SchoolUsers/Id”;

//function to get items


Function to get Users and Update

function getItems(urlForAllItems))


url: “https://abc.hyt/abc&#8221; + url,

type: “GET”,

headers: {

“accept”: “application/json;odata=verbose”,


success: function (data) {

var clientContext=SP.ClientContext.get_current();
var oList = clientContext.get_web().get_lists().getByTitle(‘DOCS’);
var itemId = getQuerystring(“pdfID”);
var itemToUpdate = oList.getItemById(itemId);
var users =[];

for(var i = 0; i < data.d.SchoolUsers.results.length;i++)



itemToUpdate.set_item(“SchoolUsers”, users);
clientContext.executeQueryAsync( );

alert(“Thanks for Update the field with new user”);


error: function (error) {




Image slideshow using document library in SharePoint 2013

Leave a comment

1) How to genereate a image slideshow with using list in SharePoint 2013?
A) Concept:

backend: Sharepoint Documnet Library
Frontend animation: bxslider (js and Css)

Step -1:
Create a document library name it as: banners and add 3 images.

Create a sharepoint page and Insert banners list webpart.
After adding webpart. Go to webpart properties by edit properties.
In JS link give the paths of our CSR (JS file and bxslider.js file).

For example: ~site/Style Library/bx-slider.js|~site/Style Library/Generatebanner.js

Before we must add bxlider.js and its css files into style library.

Download those files at: http://bxslider.com/


Add CSR coding into our Generatebanner.js.

(function () {

function OnEventsViewPostRender(renderCtx) {

//write any jquery code if you want


function SliderscriptLoadSuccess(){}
function loadCss(url) {
var link = document.createElement(‘link’);
link.href = url;
link.rel = ‘stylesheet’;

function OnEventsViewPreRender(renderCtx) {
function RenderBannerPhotos(renderCtx) {

var listData = renderCtx.ListData;
if (renderCtx.Templates.Body == ”) {
return RenderViewTemplate(renderCtx);
var bannersliderHtml = ”;

bannersliderHtml += ‘


bannersliderHtml += ‘


for (var idx in listData.Row) {
var listItem = listData.Row[idx];

var title = listItem.Title;
var itemID = listItem.ID;
var imgURl = listItem.FileRef;
var redirectURL=listItem.Url;


bannersliderHtml += divHTML;


bannersliderHtml += ‘

bannersliderHtml += ‘</div>’;
return bannersliderHtml;

function RenderEventsViewBodyTemplate(renderCtx) {
if(renderCtx.ListTitle == “BannerPhotos”) {
return RenderBannerPhotos(renderCtx);
function _registerEventsViewTemplate() {

var eventsViewContext = {};

eventsViewContext.Templates = {};
eventsViewContext.Templates.View = RenderEventsViewBodyTemplate;
eventsViewContext.OnPreRender = OnEventsViewPreRender;
eventsViewContext.OnPostRender = OnEventsViewPostRender;
ExecuteOrDelayUntilScriptLoaded(_registerEventsViewTemplate, ‘clienttemplates.js’);


5) Refresh the page you will get images sliding

For any queries feel free to contact me

Change the default image for document library folders

1 Comment

If you are not having Sharepoint 15 hive access you can change folder image in the following way.

Step 1:

upload the new folder icon in style library

Step 2:

Create a test document say ex:TestLib library and In that create few folders
1) Test1
2) Test 2
3) Test3

Now create a new Sharepoint page and insert the TestLib webpart. In the same page create a script editor webpart and add the below code.

Now you can see the folder icon changed with new image you placed in style library as mentioned in Step 1

<style type=”text/css”>
.ms-vb-icon > IMG, .ms-vb-icon > a > IMG {
width: 40px; /* increase image width to 40 px */
content:url(“https://xyz/sites/abc/Style%20Library/Images/Places-folder-red-icon.png “);

Drawback or disadvantages of using RunWithElevatedPrivileges

Leave a comment

  1. Elevation of privilege occurs only if new SPSite created inside the block
  2. Improper usage may cause Security Risk
  3. RunWithElevatedPrivileges changes Windows Security Context as well
  4. RunWithElevatedPrivileges  does not work when HTTPContext is null
  5. RunWithElevatedPrivileges  does not work for a Sandbox Solution




Latest Sharepoint 2010, 2013 interview questions

Leave a comment

  1. How do you call powershell script throught Sharepoint Page
  2. What is a worker process? What is the name of worker process fro timer job?
  3. How do you deploy master pages in production ?
  4. Location of webparts and masterpages in Sharepoint 2010?
  5. What are delegate controls In which way we can use them in sharepoint?
  6. How to convert asynchronous event handlers to synchronous ?
  7. What is meant by claims based authentication? Explain the process?
  8. Which is better CSOM or Rest Services?
  9. List event triggering twice how to stop that?
  10. What is an applicaton pool?
  11. What is a site definition Explain in detail?
  12. How many xml files does a sharepoint feature? What will be the case in timer job?
  13. What is the timer job class inherited from?
  14. Explain BCS connectivity in sharepoint 2010?
  15. What are modules in sharepoint 2010?
  16. XSLT is replaced by _____in sharepoint 2010?
  17. What is WSP? What is the use of that?
  18. Drawbacks of Runwith elevated previleages?
  19. What are the changes you noticed from sp2010 to sp2013 from developer perspective?
  20. What are the databases created when we create a new user profile service application?
  21. Explain sharepoint architecture?
  22. How to customize ribbon? explain about onet.xml file?
  23. What are the differences between webpart and visual web part?
  24. Idea on sandbox solutions?
  25. Write a caml query?
  26. How to retrieve a single item from sharepoint list with a condition using CAML? Explain step by step process?
  27. Custom search configuring and developing using sharepoint object model?
  28. Explain FBA how you configure it?
  29. What are contracts in WCF?
  30. Tell about SPwebapp,SPsite and SPweb?
  31. What are the override methods in a webpart?
  32. Step by step procedure of App model?
  33. What is managed meta data ?
  34. What is developer dashboard and how do you activate it and what details it will give?
  35. What are synchronous and Asynchronous event handlers?
  36. How do you design master page in sharepoint 2013 or sharepoint 2010?
  37. Differences between SPSite and SpWeb?
  38. What is Feature.xml and Elements.xml?
  39. What are restful services? Mention few of them?
  40. Write few powershell commands
  41. What are Application Pages? In which scenario we will use them?
  42. How can you set masterpages for different pages?
  43. What is SPFARM exactly?
  44. From which class Timerjob derived?
  45. Create custom properties for a webpart?
  46. What is a pagelayout and how it is different from master page?
  47. What is minimal download strategy ?
  48. Suppose you have a control on master page and want to show that to few members what we need to do?
  49. What are multiple document ready in javascript?
  50. What is content type hub?
  51. How many type of zones are there in sharepoint?
  52. More than 2 level groupBy is possible or not for sharepoint lists?
  53. What is distributed caching?
  54. What are the new service applications available in sharepoint 2013?
  55. What are the new features in sharepoint 2013?
  56. What is Rest API in SP2013?

Older Entries

%d bloggers like this: