Correct Syntax for using relationshipWebURL

May 5, 2015 at 1:52 PM
Edited May 5, 2015 at 1:56 PM

I am trying to use SPServices with a subsite and its parent site - I am running in the subsite, looking at data from the master site. Here is the function I am using:

function cascadelkp_department()
relationshipWebURL: "../",
relationshipList: "Employee Directory",
relationshipListParentColumn: "SharePoint_x0020_User",
relationshipListChildColumn: "Department",
relationshipListSortColumn: "Department",     
parentColumn: "Employee", 
childColumn: "Department",                                  
debug: true

The list "Employee Directory" is located at the absolute reference of http://<sharepointurl>/sites/portal. The above code is in a list in a sub site of the main site collection called http://<sharepointurl>/sites/portal/ESS. The joining fields both contain SharePoint account references, and we want to return the Department from the top level list and display/store it in the sub site list.

The Employee and Sharepoint User fields of the type Person or Group

Anyone care to help a very frustrated coder?

Any help is gratefully accepted.

May 6, 2015 at 9:57 PM
You should use "/sites/portal".

May 7, 2015 at 8:14 AM

Thanks for clearing up that query, however my lookup still doesn't work - or should I say it runs, but does not return any data. Could the reason be that that relationshipListParentColumn: and parentColumn: are both Person or Group fields and not lookups?

May 8, 2015 at 1:01 PM

Something that may help is that users are defined by an id number at the site collection level. Basically, the user would be in the format id;#username. Not sure what format your user dropdown box is, but this is where I would check first.

May 8, 2015 at 1:26 PM

We use the User Name in the field. I have checked and the underlying data matches. Would it matter if the display type of the two fields were different? I have been working on the assumption that it doesn't.


May 8, 2015 at 1:32 PM

I assumed that you meant earlier that they were user fields. This means that SharePoint treats them like a lookup field in that it stores the data as the format I mentioned. I have only been able to get these to work if I use the id of the the user. Not sure if anyone has used just the name.