Home › Forums › vLooup for SharePoint › List Base URL dynamic
- This topic has 8 replies, 2 voices, and was last updated 8 years, 7 months ago by Alexander Bautz.
-
AuthorPosts
-
-
May 5, 2016 at 11:49 #11388
Hi,
can I set the List Base URL dynamically?
I have a Project Site Tracker, with sub-sites for any projects, and I need create vLookup where the List Base URL is dynamic.For example:
Project 1 – ID1 sub-site URL: /sites/project/sub-site1/
Project 2 – ID2 sub-site URL: /sites/project/sub-site2/In the URL for sub-sites I put the ID from parent item
-
May 5, 2016 at 20:01 #11391
Hi,
I’m not sure I understand what you want to do. You can use “{currentSite}” to set the base url to the current sites base url, and then append to this.Are you looking to use a JavaScript variable here?
Alexander
-
May 5, 2016 at 20:23 #11393
Sorry Alexander,
I did not say that the vlookup is in the parent site.Yes, I want use a JavaScript variable here, because I have in the parent list the URL of sub-site and the name of the list in the sub-site is static, only the URL is dynamic
but I do not know how to do this
Gianluca
-
-
May 6, 2016 at 17:42 #11405
Hi,
this is the sample Custom JS….but now I don’t know how to replace value in vLookup blob$( document ).ready(function() { var mySite = $("#SPFieldURL a").attr("href"); console.log(mySite); var res = spjs_QueryItems( { "listName":"Attività Progetto", "listBaseUrl":mySite, "query":"<Where><Gt><FieldRef Name='ID' /><Value Type='Text'>0</Value></Gt></Where>", "viewFields":["ID","Title","Author","Created"] } ); $.each(res.items,function(i,item){ console.log(item.Title+" was created on "+new Date(item.Created).toLocaleDateString()+" by "+item.Author.split(";#")[1]); }); });
-
May 10, 2016 at 07:12 #11432
Hi,
Sorry for the delay. You can put the variable in the custom js like this:var vLookupBaseUrlVariable = "/ThePath/To/Your/Site";
Then use this in the List base URL field in vLookup config:
{var:vLookupBaseUrlVariable}
You can chain this together with your static text like this:
{var:vLookupBaseUrlVariable}/the_rest_of_the_url
Alexander
-
May 10, 2016 at 13:02 #11435
Hi Alexander,
sorry but not workingThis is the error popup:
The value currenty used is:
{var:vLookupBaseUrlVariable}Err:
Sys.ArgumentException: Sys.ArgumentException: Value does not fall within the expected range.
Parameter name: serverRelativeUrlOrFullUrlGianluca
Attachments:
-
May 10, 2016 at 22:10 #11451
Hi,
Which version of the vLookup plugin are you using?This is an undocumented feature and to be honest, I’m not exactly sure which version I added it in, but if you update to the latest version you should be OK.
Alexander
-
May 10, 2016 at 23:38 #11460
Hi,
I have the latest version,
DFFS v4.3.67
vLookup plugin backend v2.262
vLookup plugin frontend v2.266I tried with the BETA versione, but the result is the same.
-
May 14, 2016 at 15:36 #11534
In case anyone else has the same issue: we found the problem, and it will be fixed in the next revision.
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.