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 am trying to rename a folder inside a Document library. Right now I get my item and everything is good but when I try to rename it using set_item('title', 'NewFolderName') it crashes and unwinds the stack.

Is there some kind of documentation that would help us with that? Should I be doing this on the backend instead of the frontend?


context = SP.ClientContext.get_current(); 
var iter = folderList.getEnumerator();

var folder = iter.get_current();

folder.set_item('Title', 'TestTitleRename');
folder.set_item('FileLeafRef', 'TestTitleRename');


share|improve this question
Have you not only set the "Title" but also the "FileLeafRef" (to the same value as the Title)? – marco Apr 13 '12 at 19:41
What exactly is the error you are getting? Can you post your code here? See the following link on updating a listitem. (The folder is also a list item ultimately) – Vardhaman Deshpande Apr 13 '12 at 19:43
Yes i was missing FileLeafRef, post as answer and ill mark yours. Thanks :D – Dr.Denis McCracleJizz Apr 13 '12 at 20:23
up vote 5 down vote accepted

As I commented already: ;-)

You have to set not only the "Title" but also the "FileLeafRef".

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.