Query Subfolder

Forums vLooup for SharePoint Query Subfolder

This topic contains 4 replies, has 3 voices, and was last updated by  Alexander Bautz 1 month, 2 weeks ago.

  • Author
    Posts
  • #18376

    Michael
    Participant

    Hi,
    i’m not sure what exactly i’m doing wrong.

    I just want to Show items from a specific Folder, so i use the following query:

    <Query><Where><IsNotNull><FieldRef Name=’ID’ /></IsNotNull></Where></Query><QueryOptions><Folder>myLib/CustomFolder</Folder></QueryOptions>

    When i use this query e.g. in the query builder tool, i only recieve the Contents of this Folder. When i add it to the vlookup query configuration, all items / Folders in the library are shown.

    Can you please give me a hint what i’m doing wrong?!

    Regards,
    Michael

  • #18400

    Alexander Bautz
    Keymaster

    Hi,
    Based on the CAML syntax you are not doing anything wrong, but unfortunately I haven’t added support for specifying the QueryOptions like this in the vLookup setup.

    I’ll see what I can do about it in the next release.

    Alexander

  • #18402

    Alexander Bautz
    Keymaster

    I did another test and found that you can use this in the “Write your own CAML-query” field:

    <Where><Eq><FieldRef Name='FileRef' /><Value Type='Text'>SITE_URL/DOC_LIB/SUBFOLDER</Value></Eq></Where>

    Alexander

  • #19195

    Ivan Wilson
    Participant

    I’ve been able to use this CAML query to display a specific subfolder in a library in SharePoint Online.

    Ideally I would like to show the contents of this folder expanded by default. How would I automate an onClick event? This would also solve the problem with the rendering of the initial view of the vLookup – the folder name is wrapping onto a second line until you expand it (screenshot attached).

  • #19216

    Alexander Bautz
    Keymaster

    Hi,
    I have finally found out why the folder content is sometimes listed twice and will try to get out a new version of vLookup early next week.

    To expand your folder you can use this snippet (will most likely show duplicates until I get the bug fixed):

    function vLookupIsLoadedCallback(fin){
        if(fin === "YOUR_VLOOKUP_COL_NAME"){
            jQuery("#dffs_YOUR_VLOOKUP_COL_NAME .vLookupFolderName").parent().trigger("click");
        }
    }

    Change “YOUR_VLOOKUP_COL_NAME” for your vLookup column name.

    If you get duplicate files you can try wrapping it in a setTimeout like this:

    function vLookupIsLoadedCallback(fin){
        if(fin === "vLookupDocuments"){
            setTimeout(function(){
                jQuery("#dffs_YOUR_VLOOKUP_COL_NAME .vLookupFolderName").parent().trigger("click");
            },3000);
        }
    }

    Alexander

You must be logged in to reply to this topic.