Creating SharePoint 2013 Lookup List Column Visual Studio 2012 List Designer

ChiliYago picture ChiliYago · Aug 15, 2013 · Viewed 10.2k times · Source

I'm trying to use the Visual Studio 2012 SharePoint 2013 List designer to create a lookup field but it is not working

Using the designer I created a simple list (Ad Agencies) with a column (Agency Name) that I want to appear as a lookup column in a second list.

Again, using the designer I created another list and add a Lookup column. Then using the property pane I set the following Properties for the Lookup column under "Type".

List: Ad Agencies
ShowField: Agency Name

I deploy the solution and add an item to the Ad Agencies list. I then add an item to the other list but the lookup Ad Agency column contains nothing.

I am hoping someone can spot what I may be doing wrong sinse this seems so straight forward.

Thanks for reading

Answer

Purnil Soni picture Purnil Soni · Aug 17, 2013

Solution

In your lookup column properties (i.e. using Property Pane), use below values:
List: Lists/Ad Agencies (Note: we are using "Lists/" before the list name)
ShowField: AgencyName (Note: there is no space between Agency and Name)

More Info

List:

This is "List URL (site-relative URL)" value of your parent list; found under "List" tab in visual studio 2012's list designer
enter image description here

ShowField:

This is name property value of your field in parent list that is to be used as ShowField (as shown in property pane) (note: this is not "display name" property value)

enter image description here

Please refer the below blog post for more

http://jsuhail.blogspot.com/2014/08/add-lookup-column-through-visual-studio.html