Skip to main content
added 151 characters in body
Source Link
Ganesh Sanap - MVP
  • 46.4k
  • 22
  • 31
  • 63

You can also get the SharePoint List/Library using GUID instead of its Title.

To get the list instance using GUID try below code:

var listGUID = "92BFE60B-147A-49CD-8C86-38CD90987235"; // This GUID is just for example
var list = web.get_lists().getById(listGUID);

SP.ListCollection.getById Method (sp.js).

You can find the GUID of your SharePoint List/Library by following the steps from any of the below links:

  1. Finding the Id (Guid) for a SharePoint List.
  2. Sharepoint Online Addin - Add item to list - CSOM

Note: The GUID for the Style Library will be different for all SharePoint sites (If you are planning to use this Add-in across multiple sites).

You can also get the SharePoint List/Library using GUID instead of its Title.

To get the list instance using GUID try below code:

var listGUID = "92BFE60B-147A-49CD-8C86-38CD90987235"; // This GUID is just for example
var list = web.get_lists().getById(listGUID);

SP.ListCollection.getById Method (sp.js).

You can find the GUID of your SharePoint List/Library by following the steps from any of the below links:

  1. Finding the Id (Guid) for a SharePoint List.
  2. Sharepoint Online Addin - Add item to list - CSOM

You can also get the SharePoint List/Library using GUID instead of its Title.

To get the list instance using GUID try below code:

var listGUID = "92BFE60B-147A-49CD-8C86-38CD90987235"; // This GUID is just for example
var list = web.get_lists().getById(listGUID);

SP.ListCollection.getById Method (sp.js).

You can find the GUID of your SharePoint List/Library by following the steps from any of the below links:

  1. Finding the Id (Guid) for a SharePoint List.
  2. Sharepoint Online Addin - Add item to list - CSOM

Note: The GUID for the Style Library will be different for all SharePoint sites (If you are planning to use this Add-in across multiple sites).

Source Link
Ganesh Sanap - MVP
  • 46.4k
  • 22
  • 31
  • 63

You can also get the SharePoint List/Library using GUID instead of its Title.

To get the list instance using GUID try below code:

var listGUID = "92BFE60B-147A-49CD-8C86-38CD90987235"; // This GUID is just for example
var list = web.get_lists().getById(listGUID);

SP.ListCollection.getById Method (sp.js).

You can find the GUID of your SharePoint List/Library by following the steps from any of the below links:

  1. Finding the Id (Guid) for a SharePoint List.
  2. Sharepoint Online Addin - Add item to list - CSOM