Webpart to show a subfolder of a document library

The Microsoft Office 365 community forum suggested I share this question in MSDN as they were unable to help me:
For the better part of a day I've been racking my head trying to figure out how to do this in SharePoint Online.  There is lots of forums on how to do it in SP 2010 by changing the CAML statement from SPD but that doesn't seem to work with SPO.
I have a Document Library (call it "Docs").  Within the library I have a tree of nested folders (Folder 1; Folder 2, etc) and subfolders (Folder 1.1; Folder 1.2; Folder 1.3; Folder 2.1; etc).  I want to add the "Document" webpart
to a page (Testing.aspx) and have it display at the subfolder levels (e.g. Folder 1.2).
I've tried inserting a CAML WHERE clause in SPD unsuccessfully.  Page crashes every time it's attempted.
I've tried inserting a Page View WP using the Folder and HTTPS option.  The validation doesn't seem to include SPO when indicating folders and the https provides a view to the whole page, not just the doc library.
Is it possible to add a Document Library to a page and set the view to the document library to a subfolder within the library?
Thanks
Brent

http://social.msdn.microsoft.com/Forums/sharepoint/en-US/a17309b0-9666-4a11-bf8f-26662988b017/create-a-webpart-to-show-subfolder-of-existing-document-library?forum=sharepointgeneralprevious

Similar Messages

  • Document Library Upload 'Choose Folder' programming Issues

    Hello,
    I have a document library with folders and subfolders and all folders have unique security inheritance applied. Administrator is able to upload to any folder using below dialog. I want everyone who does not have permission to the folders and subfolders to
    upload file. So I decided to programmatically incorporate the ‘Choose Folder’ functionalities via SPSecurity.RunwithElivatedPrivillages(Delegate(){ “…” });
    I incorporated fetching document library and populate hierarchies inside the security code so code run as system account. However when I call
    LaunchPickerTreeDialog
    it populates based on user permission and hence if user does not have permission to folder, it does not populate at
    all.
    How can I make sure to give this Upload file functionality to all users via dialog box with full permission so it generates all folders and subfolder of the document library when user select ‘Choose Folder’ option?
    Please note that if I type the correct doc library folder url, it successfully uploads to any folders as my code is inside the elevated permission. It is not good approach to give textbox to end user to type as they might make a mistake, so I need to provide
    a ‘Choose folder’ dialog functions but I want to run as elevated privileges as everyone who do not have permission also can upload the file.
    I also tried using
    http://howtosharepoint.blogspot.com/2010/02/sharepoint-2010-folder-selector-and.html but the following code can’t be resolved
    if
    (_hiddenSelectionField != null
    && !string.IsNullOrEmpty(_hiddenSelectionField.Value))
      _listUrl.Text = GetObjectUrl(_hiddenSelectionField.Value);
      _hiddenSelectionField.Value = string.Empty; }
    How can I declare and make use of  hiddenselectionField and
    ListURL in my webpart?
    Thanks

    There's always a few challenges when trying to get around SharePoint's security model. Your options would be to try to extend the LaunchPickerTreeDialog if it's not sealed or to write a custom folder picker control. If you go the custom route, you could
    even include it directly on that upload page to avoid the additional clicks.
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Restricting user access based on a site column value in a document library.

     
    We have a business requirement to show the contents of a document library based on a value (or values) in the site column (or multiple columns). For example, my document library has a custom site column called confidentiality. This
    will have values like restricted, internal and public. Now, based on the AD Group the user belongs to, I should be able to control the access to Restricted or Restricted and Internal files from the document library. We are using SharePoint Online 2010.
    Please suggest the best way to achieve this requirement?

    SharePoint's security model doesn't allow you to specify security based on metadata. You could however create a Sandboxed Solution containing a Feature that registers a custom event receiver on the Document Library. The logic inside this
    Event Receiver would fire after editing item properties (ItemUpdated) to apply item-level permissions based on the rules you need.
    Make sure to read the article below to determine if fine-grained permissions are suitable in your case:
    http://technet.microsoft.com/en-us/library/gg128955.aspx

  • How to check for the sub folder in the document library Is already Exist using CSOM?

    Hi,
    My requirement is to create the  folder and sub folder in SharePoint document library. If already exist leave it or create the new folder and the subfolder in the Document library using client side object model
    I able to check for the parent folder.
    But cant able to check the subfolder in the document library.
    How to check for  the sub folder in the document library?
    Here is the code for the folder
    IsFolder alredy Exist.
    private
    string IsFolderExist(string InputFolderName)
    string retStatus = false.ToString();
    try
    ClientContext context =
    new ClientContext(Convert.ToString(ConfigurationManager.AppSettings["DocumentLibraryLink"]));
                context.Credentials =
    CredentialCache.DefaultCredentials;
    List list = context.Web.Lists.GetByTitle(Convert.ToString(ConfigurationManager.AppSettings["DocumentLibraryName"]));
    FieldCollection fields = list.Fields;
    CamlQuery camlQueryForItem =
    new CamlQuery();
                camlQueryForItem.ViewXml =
    string.Format(@"<View  Scope='RecursiveAll'>
    <Query>
                                            <Where>
    <Eq>
    <FieldRef Name='FileDirRef'/>
    <Value Type='Text'>{0}</Value>
                                                </Eq>
    </Where>
    </Query>
                                </View>",
    @"/sites/test/hcl/"
    + InputFolderName);
                Microsoft.SharePoint.Client.ListItemCollection listItems = list.GetItems(camlQueryForItem);
                context.Load(listItems);
                context.ExecuteQuery();
    if (listItems.Count > 0)
                    retStatus =
    true.ToString();
    else
                    retStatus =
    false.ToString();
    catch (Exception ex)
                retStatus =
    "X02";
    return retStatus;
    thanks
    Sundhar 

    Hi Sundhar,
    According to your description, you might want to check the existence of sub folder in a folder of a library using Client Object Model.
    Please take the code demo below for a try, it will check whether there is sub folder in a given folder:
    public static void createSubFolder(string siteUrl, string libName, string folderServerRelativeUrl)
    ClientContext clientContext = new ClientContext(siteUrl);
    List list = clientContext.Web.Lists.GetByTitle(libName);
    CamlQuery camlQuery = new CamlQuery();
    camlQuery.ViewXml =
    @"<View Scope='RecursiveAll'>
    <Query>
    <Where>
    <Eq>
    <FieldRef Name='FSObjType' />
    <Value Type='Integer'>1</Value>
    </Eq>
    </Where>
    </Query>
    </View>";
    //camlQuery.FolderServerRelativeUrl = "/Lib1/folder1";
    camlQuery.FolderServerRelativeUrl = folderServerRelativeUrl;
    ListItemCollection items = list.GetItems(camlQuery);
    clientContext.Load(items);
    clientContext.ExecuteQuery();
    Console.WriteLine(items.Count);
    if (0 == items.Count)
    //create sub folder here
    Best regards
    Patrick Liang
    TechNet Community Support

  • Upload and download the file same name but different extension from the document library.

    HI,
         I am using the Client Object Model (Copy. Asmx ) To upload and download the file from the document library.
    I am having the mandatory File ID for the each Document.
    I tried to upload the the document (KIF53.txt) with File ID (KIF53) uploaded successfully.
    Again I tried to Upload the document(KIF53.docx) With File ID(KIF53) its uploaded the file but it not upload the File ID in the Column
    Please find the below screen shoot for the reference.

    thanks ashish
    tried 
    My requirement is to create the  folder and sub folder in SharePoint document library. If already exist leave it or create the new folder and the subfolder in the Document library using client side object model
    I able to check for the parent folder.
    But cant able to check the subfolder in the document library.
    How to check for  the sub folder in the document library?
    Here is the code for the folder IsFolder alredy Exist.
    private string IsFolderExist(string InputFolderName)
            string retStatus
    = false.ToString();
            try
                ClientContext context
    = newClientContext(Convert.ToString(ConfigurationManager.AppSettings["DocumentLibraryLink"]));
    context.Credentials = CredentialCache.DefaultCredentials;
                List list
    = context.Web.Lists.GetByTitle(Convert.ToString(ConfigurationManager.AppSettings["DocumentLibraryName"]));
                FieldCollection fields
    = list.Fields;
                CamlQuery camlQueryForItem
    = new CamlQuery();
    camlQueryForItem.ViewXml = string.Format(@"<View 
    Scope='RecursiveAll'>
    <Query>
                          <Where>
    <Eq>
    <FieldRef Name='FileDirRef'/>
    <Value Type='Text'>{0}</Value>
                            </Eq>
    </Where>
    </Query>
    </View>", @"/sites/test/hcl/"
    + InputFolderName);
    Microsoft.SharePoint.Client.ListItemCollection listItems
    = list.GetItems(camlQueryForItem);
    context.Load(listItems);
    context.ExecuteQuery();
                if (listItems.Count
    > 0)
    retStatus = true.ToString();
                else
    retStatus = false.ToString();
            catch (Exception ex)
    retStatus = "X02";
            return retStatus;
    thanks
    Sundhar 

  • Using Content Query webpart for specific Document library with multiple managed metadata - Document with multiple metadata tags not showing up

    Hi,
    I am having an issue where when I insert a Content Query webpart into a page, and filter to managed metadata, all the right documents show up except one document that happens to have two metadata tags attached to it.  The content query webpart is set
    to only look through a specific document library.  I'm not sure what I am doing wrong.
    Here is the one document with two metadata tags:
    Below is the Content Query:

    Hi,
    As I understand, you did not get the results with multiple metadata tags through Content Query web part in SharePoint 2013.
    Check things below:
    1. Check if you have set the item limit more than the display items in Presentation section of the web part. If the item number more than item limit, the rest items will not show.
    2. Check if the item you cannot find uses the content type you have set in the content type section of content query web part.
    When you edit the properties of the item, you will see the content type the item is using.
    Best regards
    Sara Fan
    TechNet Community Support

  • How to recover a deleted document library webpart with files in it?

    Hi, 
    I accidentally deleted a document library webpart with folders and files in it. Can someone help how to recover it? What do you think happens to the files? I checked the recycle bin, there is no any deleted file related to the missing files. When I checked
    the Site Content and Structure, I can find the folders yet cant see the files in it. It gives a message that says "Object reference not set to an instance of an object". 
    Please guide. 
    thanks alot,

    Albert, 
    Follow these steps:
    1) open page: https://your_pormal/Lists/YOUR_LIST_NAME/AllItems.aspx
    2) open page in edit mode -> add webpart -> find your list in available webparts -> add
    3) click on the ribbon Stop Editing (Page tab)
    4) Now you try open library from Site Content. 
    But your webpart will looks not like a when a library was created:
    Now follow these steps:
    1) Open library settings
    2) click Create View
    3) Select Standard View (don't select All Items from view templates)
    4) Name it (for example MyAllItems)
    4) Check: Make this the default view
    5) Check: Title (linked to item with edit menu)
    6) Click Save button
    7) Now you have new View (with new address)
    8) Open page https://your_pormal/Lists/YOUR_LIST_NAME/AllItems.aspx
    9) Open it in edit mode
    10) Open list webpart in edit mode
    11) Set Selected View to MyAllItems
    12) Toolbar Type to Full Toolbar
    13) Click OK (after this step it may still showed in "wrong" style)
    14) Click on the Page tap - Stop Editing
    15) Check result ;)
    [custom.development]

  • "Files" and other tabs not visible for document library after script editor webpart is added

    I created a document library and uploaded a few documents to ti.  On the ribbon, I could see both "Files" and "Library" tabs.  I then added a Script Editor webpart to this page because I needed to run some javascript on this
    page.  Now, when I go to that document library page (AllItems.aspx) then I don't see the Files and Library tab.  My guess is that this is because these tabs are context sensitive so they only appear when Sharepoint knows you're working with a document
    library and since now I have both the webpart that shows the document library and the Script editor webpart, that context is not there.  If I click somewhere on the page close to the actual list of documents, then the Files and Library tabs reappear since
    now Sharepoint knows that I'm working with a document library.  Is there any way aroudn this?  We don't want to have to ask our customer to click somewhere on the screen in order to get access to these tabs.  I'm not sure why Sharepoint would
    be confused by the Script editor webpart.  It is not visible so when the page is not in edit more, you can't even see that Script editor.  So, my question is: is there any way to:
    - either find some other way of using javascript on this page (maybe external javascript file with some link to it on the page?
    - or, some way to force the Fiels and Library tabs to be visible no matter what (i.e. despite having the Script editor webpart on the page).
    I also experienced this issue when I wanted to insert some customized text on the same page that had a document library.  For example, I created a document library and then on the AllItems.aspx page I inserted a content editor webpart so that I can
    show some text at the top.  That also caused the Files and Library tabs to disappear.
    thanks,

    Hi,
    I understand Files/Libraray tab disappear after you add web parts to a document library, once you click somewhere in library list, it will appear again.
    This is by design. As workaround, please try to use SharePoint Desginer to edit Allitems page of document library instead of using script web part.
    https://social.msdn.microsoft.com/Forums/office/en-US/fd1bb098-6425-437c-b3f8-25bf65bcaad3/ribbon-control-disappears-on-sharepoint2013-document-libraries-when-content-editor-web-part-has?forum=sharepointdevelopment
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Show custom EditForm from a specific document library view

    Hello,
    I've created a custom EditForm that I would like to show when the user clicks the "<label for="ShouldDisplayEdit">Edit" (link to edit item)</label> icon; however I just want to show this EditForm for a specific view.
    I have a listview webpart (actually an "app") for the library and this specific view set on a page. However, it opens the default edit form instead of the custom one. (StatusEdit.aspx). I don't want to set StatusEdit.aspx as the default, as it
    has fewer fields than the default edit form.
    I am able to hide fields conditionally using SPClientTemplates.TemplateManager.RegisterTemplateOverrides, but it's been a lot of work to try to make it match the requirements I have. I'd really like to have the custom edit form work if it's possible.
    Thank you for your help!
    Best Regards,
    Kevin Worthington

    Hi,
    According to your description, my understanding is that you want to specify the custom EditForm for a specific document library view.
    We can change the link to edit item button url using Jquery to achieve it.
    Here is a code snippet for your reference:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    function changeurl()
    $(' ms-itmHoverEnabled ms-itmhover ms-droppable).find('ms-vb-lastCell ms-cellstyle ms-vb-icon ms-vb-lastCell').attr(‘href’,”http://new url”);
    </script>
    Here are some detailed articles for your reference:
    http://stackoverflow.com/questions/179713/how-to-change-the-href-for-a-hyperlink-using-jquery
    http://stackoverflow.com/questions/8729830/jquery-find-td-of-tr-with-class-and-make-changes-for-a-telerik-mvc-grid
    Thanks
    Best Regards
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jerry Guo
    TechNet Community Support

  • How to show more than one PDF-Documents

    One more question to the gurus. Can anyone tell me how i can show more that one pdf-form without having to use the container-window in the sdk-example. i would like to open and show a number of pdf-documents and react e.g. when a form closes.

    "Which option is the third one? You mean "Or, make an application with
    one AcroPDF box in one form. Save it as an EXE (or whatever). You can
    now run multiple copies of your application".
    If this isn't clear, I'm not sure how to make it more clear, but I can
    try.
    Do you turn your application into an EXE today? Ok, then just start 3
    copies. Don't you have three PDF viewers?
    Aandi Inston"
    i still do not understand... let me try to explain the application a little bit. i am developing an add-in for outlook. the user can open a main-form with a lot of information on it and e.g. a button edit pdf-document. after clicking the button a pdf-document is shown and the user can view and edit it. the user must be ablke to switch back to the main-form without closing the pdf-document and open an other one to compare the two...

  • Just converted a PDF document to Word, none of the graphics from the PDF file show up in the Word document?

    Just converted a PDF document to Word, none of the graphics from the PDF file show up in the Word document?
    What do I need to do to bring the graphics and exhibits from the PDF file to the Word file?

    Hi jackp52432917,
    How was that PDF file created? Please see  Will Adobe ExportPDF convert both text and form... | Adobe Community
    It could be that the PDF file you're converting was created using a third-party application, and it doesn't contain all the information necessary to ensure a clean conversion. Have you had similar troubles converting other PDF files?
    Best,
    Sara

  • Document library in Explorer showing empty folder and edit in microsoft word not is also not working

    Hello
    I am facing strange issue. I have two different SP2010 environment on two different servers i.e. dev1 and dev2 and each envionment we have one web application i.e.
    http://dev1/ and http://dev2/
    I am testing this environment from my desktop which has Windows 7, IE8, Office 2010.
    I tested Dev1 url on my desktop, and able to open document library using windows explorer, I am able to see files and folders. I am also able to use "Edit in Microsoft Word" is options is working on my desktop. Infact tested on other machine, it
    is working fine.
    Then I tested Dev2 url, I am able to open dcument library using windows explorer on my desktop, but it is not showing any files and folders and when I tried to to use "Edit in Microsoft Word" got the error "The document could
    not be opened for editing. A Microsoft SharePoint Foundation compatible application could not be found to edit the document". When I test dev2 url on other machine it is working without any problem. However I am able to upload and download from the document
    library.
    I googled a lot but could not findout a perfect solution, Please let me guide what I am missing here.
    Avian

    Hi Avian,
    Which suggestions did you do for resoving this issue?
    Below are some troubeshotting for you:
    Make sure your IE 8 is 32-bit
    Add the URL of dev2 to Trusted Site
    Make sure that SharePoint OpenDocumentsClass and SharePoint OpenXMLDocuments are enabled as IE Options->Programs->Manage add-ons
    Repaire Office 2010 under Control Panel
    Here is a similar post, in the reply section, there are some suggestions, please take a look at:
    http://social.technet.microsoft.com/Forums/projectserver/en-US/3e8c0976-2794-49a2-92fe-6a254b3cc4ca/a-microsoft-sharepoint-foundation-compatible-application-could-not-be-found?forum=projserv2010setup
    Also check whether this link is useful:
    http://support.microsoft.com/kb/2823322/en-us
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • SharePoint 2013: Hide/Show Column fields while uploading document in Document Library

    Dear all,
    I have created a document Library LIB001 and I have created One Column of type Choice, drop down list, (CCHOICE) and I have created 3 other columns, (Column1, Column2, Column3).
    What I want is while uploading a file in the document library, when I choose a certain value from CCHOICE, i want to show/hide and/or make the column mandatory.
    Can anyone help/guide me how to achieve this?
    Many Thanks
    Vinay

    Dear all, I am trying the following code, but it's not entering the onchange of drop down list event. <script> $(document).ready(function () { var countryField = SPUtility.GetSPField('Document Type'); var countryFieldValue = countryField.GetValue(); alert
    (countryFieldValue); // ----- Hide/Show the field based on new selected value. var id = SPUtility.GetSPField('Document Type').Dropdown.id; alert ('field ID: '+id); $('#' + id).on('change', function () { alert ('Inside on Change:'+countryFieldValue); if (countryFieldValue
    == 'Type1') { SPUtility.GetSPField('Column1').Hide(); } else if (countryFieldValue == 'Type2') { SPUtility.GetSPField('Column2').Hide(); } }); }); </script> Can anyone help me please. Many Thanks & Regards Vinay

  • Show in a Iview all documents of an user of the whole portal

    Hello everybody,
    I want to show in an Iview all documents of an user of the whole portal, not only the documents under his folder /userhome/Personal Documents
    Any ideas?
    Thanks in advance
    Guillermo.

    ... and of course I have to add that this can be done with very few programming (but with that - with much more possibilities) by using a redirect "proxy iView", which is described in detail (and is taking just this scenario as one use case among others) on the slides of my TechEd presentation "Implementing Dynamic iView Properties", at least available for TechEd visitors now.
    On the other hand, searching for "proxy iView" on SDN will return different results where at least I have described the basic idea.
    Hope it helps, too,
    Detlev

  • Show the last published documents in a view for a document library.

    Hello!
    At our company we have a document library with many documents. These documents are evolving and are therefore going from major versions to minor versions to major versions again. To be able to get a good overview of the last "official" versions
    we would need to have a view that shows the last "Approved" versions of each document (if any approved versions exist). This is basically the same as watching the document library from a user that only own reading access and therefore only sees the
    "published" versions.
    In our case this view should be used by people that own editing rights as well to the documents. 
    Is it possible to accomplish this?
    I tried to use the tip from the following site: link 
    The "?IncludeVersions=TRUE"
    did not work though. 

    Hi AndersObserve,
    I understand that you have a document library that you have enabled content approval(if not, enable it) and versioning, then
    you want to create a view to filter major(approved) documents, then you can filter on the ApprovalStatus field. Try to create a new standard view, filter the view when the ApprovalStatus is equal to Approved, then the view will display the published version
    document.
    Best Regards.
    Kelly Chen
    TechNet Community Support

Maybe you are looking for

  • Getting f4 help

    code is written in javascript to get the valid values in a table . once the value is selected from the table table vanishes. to that extent it is working. now the value is to be populated on to the input field. but no event is actually getting trigge

  • IPhoto 9.5.1 - Trying to share 1 libary

    Using iPhoto 9.5.1.... Trying to share one libary on a home network between 2 imacs, a mini mac server and a laptop (and two iphones) - I am organised and my husband is not - It would be great if we could share our family photos in one great master a

  • When I open a new tab Bing is the browser on the page...I have a Mac not a PC. How can I get rid of this?

    I have deleted Bing as an optional browser but it still opens when I open a new tab

  • Material Document

    Dear All, To cancel a material Document I use MBST.... i enter the Mat. Doc number and the system generates a new document number for the cancellation doc.... My question is that where i can see the reference document which was actually cancelled..??

  • Adobe Acrobat X Pro Error Message

    Hello there: I am constantly getting this message when I try and move a pdf that I just worked on into the trash. I then have to re-start my computer to move them into the trash. I just purchased this product a month or so ago. Screenshot of error is