SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I get list properties like BaseTemplate, ItemCount, ListItemDeletedDate etc. via Javascript Client Object Model for SharePoint 2013?

share|improve this question
up vote 3 down vote accepted

Okay, so I got some answers on MSDN which were very helpful.

Here is the code-snippet which helped me:

<script type="text/javascript" src="/_layouts/15/init.js"></script>
<script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script>
<script type="text/javascript" src="/_layouts/15/sp.js"></script>

<script type="text/ecmascript">
    var customlist ;
    function GetListInformation(listGuid) {
        var clientContext = new SP.ClientContext.get_current();
        var oWebsite = clientContext.get_web();
        customlist = oWebsite.get_lists().getById(listGuid);
        clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));

    function onQuerySucceeded() {
         alert("Last item deleted time : " + this.customlist.get_lastItemDeletedDate() );
         alert("Base Type ID : " + this.customlist.get_baseType());
         alert("Item Count : " + this.customlist.get_itemCount());


    function onQueryFailed(sender, args) {
        alert(" Failed");
share|improve this answer
here's rest of properties if you need, – Muhammad Raja Apr 16 '13 at 8:39

Could you not get your properties using REST? Unfortunately I don't have access to my SharePoint 2013 machine for testing myself, but the URL would be similar to http://'site'/_api/web/lists/getbytitle('listName'). You can play about directly in the browser to see the results. Once you have found the correct REST command, you could then use $.ajax() to call within your javascript.

I've written a blog about cross domain REST calls, that won't have your answer, but you will be able to see how to write a ajax call to rest.

I hope it helps.

share|improve this answer
Thank you for this. I actually need this for another project. – Daniel Ziga Apr 16 '13 at 8:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.