0

I have an AddIn that works fine to install in an English setup of Sharepoint. However, when I test this in another language I run into an issue.

The issue is with this code:

var list = web.get_lists().getByTitle("Style Library");

I get the error that the list "Style Library" can't be found on the site https://***.sharepoint.com/sites/Testsite.

How can I do this in another way without being language dependent? I've tried to search everywhere but can't find a way. Is this something to do with "Metadata Language"? Can that be changed for an AddIn?

moviaa
  • 402
  • 1
  • 4
  • 16
  • have you tried to use var list = web.get_lists().getByTitle("Style%20Library"); because sometimes I get issues with list names when they got spaces, so I use the replace of the space which is %20 or if it is a custom list or library i use (_) instead of space when i create it, try to paste the response message of the xhr that could help helpers to figure out. – Kai Mar 01 '20 at 22:56

1 Answers1

0

To solve the language issue, we can use web.get_lists().getById method to achieve it.

var list = web.get_lists().getById('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
LZ_MSFT
  • 4,079
  • 1
  • 8
  • 9