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

I have different sites like


and each having one Library with the same name called Lib1. Now I want to get GUID of this library using jquery or using any other method that is on client side.

share|improve this question
up vote 4 down vote accepted

You can get it using REST query. The code should be:

$( document ).ready(function() {

function GetListGuid(listTitle){
    try {
    //REST Query to get the List Title 
        url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('"+listTitle+"')?$select=Id",
        type: "GET",
        async: false,
        headers: { "Accept": "application/json;odata=verbose" },
        success: function (data, textStatus, xhr) {
        error: function (data, textStatus, xhr) {
catch (ex) {

Hope this helps!

share|improve this answer
Thanks it works :) – DRS Feb 22 at 10:14

Nice Solution added by @users1100 for SharePoint 2013.

You can try JSOM also. It will work for both 2010 & 2013.

var clientContext = new SP.ClientContext();
var oList = clientContext.get_web().get_lists().getByTitle('Name of List or Library');
clientContext.executeQueryAsync(function() {
}, function() {
    // error handler
share|improve this answer

On a page with the ListView WebPart displayed the listGUID is available as


share|improve this answer

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.