Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Get folder ID with JSOM

$
0
0

I need to fetch folder ID using JSOM. Actually, I need to update one of its columns, that is why I want to get ID.

For now, I can get its name:

function get_currentFolder(OnSuccess, OnError) {
    var context = SP.ClientContext.get_current();
    var web = context.get_web();
    var currentFolder = web.getFolderByServerRelativeUrl(decodeURIComponent(ctx.rootFolder));
    context.load(currentFolder);
    context.executeQueryAsync(
      function () {
          OnSuccess(currentFolder);
      },
      OnError
    );
}

get_currentFolder(function (folder) {
        console.log('Current folder:' + folder.get_name());
    }, function (sender, args) {
        console.log(args.get_message());
    });

Is there a way to get ID or is there a way to update one column of that folder in a different way??


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>