Home › Forums › vLooup for SharePoint › vLookup Default Folder Structure
- This topic has 4 replies, 2 voices, and was last updated 3 years, 3 months ago by Claude Cassidy.
-
AuthorPosts
-
-
September 6, 2021 at 14:46 #34408
When using the “Add items to this folder” option in the vLookup Config, I noticed that if I use [currentItem:FieldInternalName] as the root folder, I cannot create any sub folders inside that root folder. For example, if I use [currentItem:Title]/Legal Documents neither the Root folder or the subfolder get created. However if I use Company/Legal Documents it creates the folder and sub folder. Is there a way I can use a currentitem:FieldInternalName and setup a sub folder automatically?
-
September 6, 2021 at 15:40 #34410
You can try defining a variable in your Custom JS like this:
var vLookupFolderName = getFieldValue("Title") + "/Legal Documents";
Now use this in the Add new items to this folder field:
{var:vLookupFolderName}
Alexander
-
September 7, 2021 at 09:15 #34415
Hi Alexander. Thanks so much for the fast reply. Okay so I created a variable using the custom JS tab as per your reply above, however it seems the Var is not being captured, when using the the {var:vLookupFolderName} in the “Add new items to this folder” and trying the vLookup, it shows the following error when trying to upload a document.
The file or folder name “Credit App Legal Documents//Legal Documents/Test Document.pdf contains invalid characters. Please use a different name. Common invalid characters include the following: # % & * : < > ? / { | }
It seems that the space between the two // is what is causing the issue, as that’s where the variable is supposed to be adding the “Title” name. I have tested the variable by setting a rule to set a field to {var:vLookupFolderName} when Title is changed and it only shows the last part which is /legal documents and not what the field Title has been set to. Any idea what could be causing this at all?
-
September 7, 2021 at 20:07 #34428
Hi,
Sorry, but I checked and adding a rootfolder/subfolder combination won’t work here if the rootfolder doesn’t already exist. Also, the [currentitem:fin] will pull in the value when the vLookup field is rendered and it won’t update if you change the field.I can look into changing this, but if you need to create a predefined set of folders it can be done using custom js so if you can give me some more details I can write a snippet to create these folders.
Alexander
-
-
September 8, 2021 at 06:54 #34439
Hi Alexander. Not a problem, thanks again for all the help. when you mentioned that the rootfolder needed to be created first, I created a workflow that adds a rootfolder, based off of the Registration Number field, to the document library, then on the editform I adjusted the vlookup “add new item to this folder” to point to [currentItem:RegistrationNumber]/Legal Documents and all is working well now. Thanks a million for all the help, it is greatly appreciated.
-
-
AuthorPosts
- You must be logged in to reply to this topic.