Home › Forums › vLooup for SharePoint › Query Subfolder
- This topic has 6 replies, 3 voices, and was last updated 5 years, 11 months ago by Alexander Bautz.
-
AuthorPosts
-
-
October 7, 2017 at 10:21 #18376
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 -
October 9, 2017 at 20:15 #18400
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
-
October 9, 2017 at 20:32 #18402
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
-
January 5, 2018 at 12:56 #19195
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).
Attachments:
-
January 6, 2018 at 17:21 #19216
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
-
November 9, 2018 at 15:12 #22784
Hi Alexander,
i have another question on this topic:
In my case, we always lookup for the contents in a folder where the foldername is equal to the current items title.
Now when the vlookup column is setup within the list view, we have 2 “problems”:1.) empty folders are also displayed (which is understandable from the function)
2.) we don’t “need” to see the foldername, because ist the same as the titleSo my question:
Is there any way to “hide” the folder icon and just show the contents under the folder?Best Regards,
Michael -
November 11, 2018 at 10:08 #22822
Hi,
You will have to use custom js – try it like his to automatically expand the first folder and then hide the folder – change vLookupDocuments with the name of your vLookup field:function vLookupIsLoadedCallback(fin){ if(fin === "vLookupDocuments"){ jQuery("#dffs_vLookupDocuments .vLookupFolderIcon:first").parent().trigger("click").parents(".vLookupTableRow:first").hide(); } }
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.