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');


  • 1
    Have you not only set the "Title" but also the "FileLeafRef" (to the same value as the Title)?
    – marco
    Commented Apr 13, 2012 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) msdn.microsoft.com/en-us/library/hh185011.aspx Commented Apr 13, 2012 at 19:43
  • Yes i was missing FileLeafRef, post as answer and ill mark yours. Thanks :D Commented Apr 13, 2012 at 20:23

1 Answer 1


As I commented already: ;-)

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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