Get folder ID with JSOM

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??

Check if below can help
http://www.c-sharpcorner.com/UploadFile/anavijai/how-to-get-the-number-of-items-inside-the-folder-in-sharepoi/
http://stackoverflow.com/questions/22629710/get-sub-files-with-folders-ids-client-object-model
var folders = new Dictionary<string,Microsoft.SharePoint.Client.Folder>();
var folderNames = new[] {"Orders","Requests"};
foreach (var folderName in folderNames)
var folderKey = string.Format("/Shared Documents/{0}", folderName);
folders[folderKey] = context.Web.GetFolderByServerRelativeUrl(folderKey);
context.Load(folders[folderKey],f => f.Files);
context.ExecuteQuery(); //execute request only once
//print all files
var allFiles = folders.SelectMany(folder => folder.Value.Files);
foreach (var file in allFiles)
Console.WriteLine(file.Name);
If this helped you resolve your issue, please mark it Answered

Similar Messages

  • My MacBook won't start up. Get folder icon with ? In it.  Ideas....    Thanks

    My MacBook won't start up.  I get a folder icon with a "?" in it.  Any ideas?  Thanks.

    The MacBook cannot find a startup disk...could be a corrupted hard drive or failed hard drive.  If you have the install disk for your Mac OS X, you show 10.5.8, try booting holding the C key so you startup on the installation disk.  If that works, use disk utility to see if you can do a repair of the internal hard drive and fix system files that are bad, or even do a reinstall so you cleanup bad files.
    If that does not work, then a trip to the Apple store genius bar to have the hard drive checked out and possibly replaced.

  • Get Folder Content with category attributes

    Hi Gurus,
    I want to get all documents of a folder with few custom category attributes values.
    How can I query this?
    Thanks
    JO

    Yes, you make a SearchExpression tree that holds all your attributes and values to compare them to. Here is something I used for a category with 7 attributes:
            AttributeRequest[] ar = new AttributeRequest[]{
                new AttributeRequest(Attributes.CLASS_NAME, null),
                new AttributeRequest(Attributes.METADATA_ATTRIBUTES, new AttributeRequest[]{
                new AttributeRequest(Attributes.ATTRIBUTE_NAME, null),
                new AttributeRequest(Attributes.DISPLAY_NAME, null)
            NamedValue[] SEARCH_INCLUDES_VERSIONHISTORY = new NamedValue[] {
                new NamedValue(Options.SEARCH_VERSION_HISTORY,Boolean.TRUE)
            NamedValue[] PRI_SORT_NAME_ASC = new NamedValue[] {
                new NamedValue(Options.PRIMARY_SORT_ATTRIBUTE,Attributes.NAME),
                new NamedValue(Options.PRIMARY_SORT_DIRECTION,Boolean.TRUE) // asc
            NamedValue[] options = (NamedValue[])FdkUtils.combineArrays(PRI_SORT_NAME_ASC, SEARCH_INCLUDES_VERSIONHISTORY);
            AttributeRequest[] reqAtr1 = new AttributeRequest[]{
                new AttributeRequest(Attributes.CATEGORIES, new AttributeRequest[]{
                    new AttributeRequest(Attributes.CUSTOM_ALL, null),
                    new AttributeRequest(Attributes.CATEGORY_CLASS_OBJECT, null) }),
                new AttributeRequest(Attributes.PATH, null),
                new AttributeRequest(Attributes.URL, null)
            Item kat = FdkUtils.getCategoryObject(s_WsCon, null, "DICOM", ar);      
            String className = (String)FdkUtils.getAttribute(kat, Attributes.CLASS_NAME);
            String atr1 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "Ime pacijenta");
            String atr2 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "ID pacijenta");
            String atr3 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "Ime per doktora");
            String atr4 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "Ime ref doktora");
            String atr5 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "ID studije");
            String atr6 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "Opis studije");
            String atr7 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "Datum studije");
            String atr1Operand = "[" + className + FdkConstants.SEPARATOR + atr1 + "]";
            String atr2Operand = "[" + className + FdkConstants.SEPARATOR + atr2 + "]";
            String atr3Operand = "[" + className + FdkConstants.SEPARATOR + atr3 + "]";
            String atr4Operand = "[" + className + FdkConstants.SEPARATOR + atr4 + "]";
            String atr5Operand = "[" + className + FdkConstants.SEPARATOR + atr5 + "]";
            String atr6Operand = "[" + className + FdkConstants.SEPARATOR + atr6 + "]";
            String atr7Operand = "[" + className + FdkConstants.SEPARATOR + atr7 + "]";
            SearchManager sem = s_WsCon.getSearchManager();
            SearchExpression seExp1 = new SearchExpression();
            seExp1.setOperator(FdkConstants.OPERATOR_EQUAL);
            seExp1.setLeftOperand(atr1Operand);
            seExp1.setRightOperand(imePac);
            SearchExpression seExp2 = new SearchExpression();
            seExp2.setOperator(FdkConstants.OPERATOR_EQUAL);
            seExp2.setLeftOperand(atr2Operand);
            seExp2.setRightOperand(IDPac);
            SearchExpression seExp3 = new SearchExpression();
            seExp3.setOperator(FdkConstants.OPERATOR_EQUAL);
            seExp3.setLeftOperand(atr3Operand);
            seExp3.setRightOperand(imePerDok);
            SearchExpression seExp4 = new SearchExpression();
            seExp4.setOperator(FdkConstants.OPERATOR_EQUAL);
            seExp4.setLeftOperand(atr4Operand);
            seExp4.setRightOperand(imeRefDok);
            SearchExpression seExp5 = new SearchExpression();
            seExp5.setOperator(FdkConstants.OPERATOR_EQUAL);
            seExp5.setLeftOperand(atr5Operand);
            seExp5.setRightOperand(IDStud);
            SearchExpression seExp6 = new SearchExpression();
            seExp6.setOperator(FdkConstants.OPERATOR_EQUAL);
            seExp6.setLeftOperand(atr6Operand);
            seExp6.setRightOperand(opisStud);
            SearchExpression seExp7 = new SearchExpression();
            seExp7.setOperator(FdkConstants.OPERATOR_EQUAL);
            seExp7.setLeftOperand(atr7Operand);
            seExp7.setRightOperand(datStud);
            SearchExpression seExp8 = new SearchExpression();
            seExp8.setOperator(FdkConstants.OPERATOR_AND);
            seExp8.setLeftOperand(seExp1);
            seExp8.setRightOperand(seExp2);
            SearchExpression seExp9 = new SearchExpression();
            seExp9.setOperator(FdkConstants.OPERATOR_OR);
            seExp9.setLeftOperand(seExp3);
            seExp9.setRightOperand(seExp4);
            SearchExpression seExp10 = new SearchExpression();
            seExp10.setOperator(FdkConstants.OPERATOR_AND);
            seExp10.setLeftOperand(seExp5);
            seExp10.setRightOperand(seExp6);
            SearchExpression seExp11 = new SearchExpression();
            seExp11.setOperator(FdkConstants.OPERATOR_AND);
            seExp11.setLeftOperand(seExp8);
            seExp11.setRightOperand(seExp9);
            SearchExpression seExp12 = new SearchExpression();
            seExp12.setOperator(FdkConstants.OPERATOR_AND);
            seExp12.setLeftOperand(seExp10);
            seExp12.setRightOperand(seExp7);
            SearchExpression seExp = new SearchExpression();
            seExp.setOperator(FdkConstants.OPERATOR_AND);
            seExp.setLeftOperand(seExp11);
            seExp.setRightOperand(seExp12);
            NamedValue[] result = sem.search(seExp, options, reqAtr1);
            NamedValue[] nvRezultat = null;Hope this helps!
    Pedja

  • Changed out internal harddrive, now getting folder icon with ? when booting.  What to do now?

    See subject

    First, shut down.
    1. Boot from install disc (press power button, immediately insert install disc and hold down c key).
    2. Select your language.
    3. Open Disk Utility from Utilities menu.
    4. Select the HD in the left pane (the manufacturer’s name and the HD model number).
    5. Click on the Erase tab.
    6. Choose the Format: Mac OS Extended (Journaled).
    NOTE: if you want to zero the HD (which I always think is a good idea, but does take time), click on Security Options, click the button for Zero Out Data, click OK. The larger the HD, the longer this will take, in some cases several hours.
    7. Click on Erase and wait for the entire process to finish.
    8. Click the Partition tab.
    9. Click on Volume Scheme and choose the number of partitions (normally just one unless you have other plans).
    10. Click on the Options button (located underneath the Volume Scheme pane) and select GUID.
    11. Click Apply.
    12. Quit Disk Utility and continue with the installation process to install OS X; when finished, restart, repair permissions, run updates (in Apple Menu > Software Update), and repair permissions again.

  • HT204408 My applications folder has a black question mark on it at the bottom of my screen. I do not know what error I made, but my fan effect of the previous applications has gone away. Can I get some help with this?

    One day ago I inadvertantly removed my applications folder. In it's place is a folder with a black question mark which appeared after I attempted to open up the applications file. Also, previously when I clicked on the file applications would open in a fan display. Could I please get some assistance with this?

    ...removed my applications folder.
    From where? And to where?
    If you trashed it and emptied the trash, what backup, if any, do you have? If it's still in the Trash, move it back.
    If no backup, reinstall Snow, which will give you the version as of the DVD you use, then update back to 10.6.8, and run all other needed updates, including any security updates. This should save all your third party programs, as well as settings.
    The white puff of smoke is nothing, it only means you moved it out of the Dock. If you still have it, or had it, as soon as you open it it would reappear in the Dock. The item in the Dock is only a kind of alias.

  • How do I install OS software on a erased hard drive all I get is folder icon with blinking ?

    Trying to install OS10.6 on erased hard drive but just getting folder with blinking ? symbol any ideas?

    Startup with the Snow Leopard installation disk ALREADY IN THE DRIVE. 
    If it pops out, push it back in during startup.  It will take a long time, but be patient.

  • Tthe flood filter is in my plugins folder along with the other plugins I have, but not in cc 2014. It's also in Adobe bridge associated with cc 2014, but not in cc 2014 Photoshop. i hope you get this because i forwarded  your info to HCS and now I'm all m

    the flood filter is in my plugins folder along with the other plugins I have, but not in cc 2014. It's also in Adobe bridge associated with cc 2014, but not in cc 2014 Photoshop. i hope you get this because i forwarded  your info to HCS and now I'm all mixed up as to this gets forward.

    Unfortunately, you are not addressing Adobe here in the user forums.
    However, there are many highly experienced volunteer users here willing to help.
    Can you please clarify:  are you saying that your Flood filter (whatever that is) is in your Bridge folder but not in Photoshop?
    UPDATE:  I Googled your Flood Filter and discovered it's not an Adobe filter at all.  Have you contacted its manufacturer, Flaming Pear?  What do they say?

  • I Lost My Application Folder and I Can't Get It Back With It's Previous Features

    I lost my application folder!! I have tried dragging it from my hard drive but all I have left over is my skype. when i was trying to change the size of my screen's window i accidently picked up the applications folder and when i let go of my mouse it disappeared and now I cant get it back with everything in it. (front row, screen grab, etc)

    First of all don't empty the Trash.
    Second, it is unlikely the folder is gone, you just dragged it someplace else. Here is one easy way to find it:
    Go to Spotlight and type in the name of one of the programs that you had in that folder. Click on the program when it finds it. When the program launches, click and hold its icon in the Dock until you get the pop up menu. Choose "options > show in Finder".
    That will open the enclosing folder and select the program. While you are there drag the folder back to where you want it.

  • At start up I get a white screen then eventually a blinking folder icon with a question mark in the middle

    Help!  As of today, my iMac will not boot up.  When I turn it on I get a blank white screen then, after about a minute, a blinking folder icon with a question mark in the middle.

    Find your original install disk, insert it and re-boot holding the "C" key during startup. It will take longer but should boot. Then you need to select Disk Utilityfrom the Menu Bar. Do a Repair Disk on your hard drive. When it finishes re-boot normally.

  • On. Startup I get a flashing folder icon with a question mark

    My computer won,t start. After about 30 seconds I get a blinking folder icon with a question mark. I have never seen this before.

    There are four general causes of this issue:
    1. The computer's PRAM no longer contains a valid startup disk setting when there aren't any problems with the disk itself. This can be checked for by pressing the Option key and seeing if the drive appears.
    2. The internal drive's directory structure has become damaged. This requires usage of an alternate bootable system to perform the repair.
    3. Critical system files have been deleted. This requires usage of an alternate bootable system to reinstall them.
    4. The internal drive has died or become unplugged. This is the most likely case if the computer took a sharp impact or there are unusual sounds coming from its location.
    (101798)

  • Mac won't boot up..get gray screen with a folder and ? mark what do i do?

    my mac pro won't boot up..get gray screen with a folder and ? mark on the folder..help

    Hi,
    Rather than write up what I did, here is a link to an Apple support document with the instructions to follow.
    I hope this is helpful.  Good luck.
    http://support.apple.com/kb/ts1440

  • Installed hard drive in bay 2 now get flashing folder icon with ? mark

    Mac Pro 1.1, OS x 10.7 - installed storage hard drive in bay 2 now get flashing folder icon with ? mark

    found the answer - hold down opt/alt key, reboot, choose drive with os installed. it worked.

  • Installed new hard drive in imac and i get folder with question mark, put in OS install disk and it does nothing? All I have is wireless key board and mouse, is this a factor?

    Installed new hard drive in imac and i get folder with question mark, put in OS install disk and it does nothing? All I have is wireless key board and mouse, is this an issue?

    Other than put disc in you don't give much info about what you've done. With the install disc inserted restart your Mac while holding the C key, that should start it up from the install disc. Should also work fine with a wireless Apple keyboard.

  • HT4718 at start up I am just getting a grey folder icon with a ? inside it

    at start up I am just getting a grey folder icon with a ? inside it

    Press the Command and R keys and either use the Disk Utility to repair the internal drive or the Installer to put a new OS onto it.
    (83635)

  • Mac not will start up getting a folder symbol with ? in it, any ideas

    mac not will start up getting a folder symbol with ? in it, any ideas

    The folder with ? means the system can't find anything to boot from.  See this Apple note: http://support.apple.com/kb/TS1440

Maybe you are looking for

  • Problem installing Adobe Photoshop CS3 Trial

    When installing the trial version of Adobe Photoshop CS3, I get an error message saying that there has been a "fatal error". What is the problem? I have re-downloaded the exe more than once, closed all programs, etc. Thanks for any help.

  • Is it possible to backup an external hard drive connected to a TC?

    Via the USB port on the time capsule?

  • HELP! problem in transformation

    For instance, there are some records in data table. but i only can get one record (the first of all data from table) after transforming these records to xml file.how to transform all records in data table to xml file and make each record be placed in

  • Why doesn't the update part of the App Store work?

    Why doesn't the update part of the App Store work? It says I have an update and the screen is white. I've already restarted the phone. Every other part of the App Store works. I have the iPhone 4. Upgraded a week ago to iOS6 and it was working fine u

  • Moxa Ethernet to Serial with Visa Showing Strange Characters

    Before I go to Moxa with these questions, I was hoping to see if someone could easily say "I've seen that before and this is probably what's wrong." I am using a Moxa device that is just ethernet to serial (NPort 5150). As far as I can tell I have ev