Add lookup field type column in list using visual studio 2013 by autohosted apps in sharepoint 2013

In this post, we will discuss how we can add lookup field type column in the list using visual studio 2013 by autohosted apps in SharePoint 2013.

Also, you can check my previous posts on:

Difference between SharePoint-hosted, auto-hosted and Provider-hosted apps in SharePoint 2013

Add Custom Actions to List Item Menu in SharePoint 2010 Using SharePoint Designer 2010

Different search syntax supported by SharePoint 2013

Follow the below steps:

1. Open Visual Studio, then Add New Project and then select “App for SharePoint 2013” as shown in the fig below:

Add lookup field type column in list using visual studio 2013 by autohosted apps in sharepoint 2013
Add lookup field type column in the list using visual studio 2013 by autohosted apps in SharePoint 2013

2. Visual Studio will ask you for some details of your new application as shown in the fig below:

 Add lookup field type column in list using visual studio 2013 by autohosted apps in sharepoint 2016
Add lookup field type column in the list using visual studio 2013 by autohosted apps in SharePoint 2016

3. Below is your visual studio solution explorer now:

 Add lookup field type column in list using visual studio 2013 by autohosted apps in sharepoint 2019
Add lookup field type column in list using visual studio 2013 by autohosted apps in SharePoint 2019

4. When settings are okay click Finish and see what Visual Studio generated for you. You have two projects – one for SharePoint app and the other for a web application that contains actual application logic and server-side code.

5. Now right click SharePoint apps and add a new item as a list.

6. Add two list like list1 and list2

7. Now by default in list Title column is already in the list1 and list2

8. Now select list2 and add one column1 and type is lookup.

9. Now select the column1 from list2 and go to properties

Add lookup field type column in the list using visual studio 2016 by autohosted apps in SharePoint 2016

10. Here you find the Type, under this you add list1 and add show field as Title (Title is lookup field from list1). see as an image

autohosted apps in sharepoint 2013
autohosted apps in SharePoint 2013

11. Now you deploy the apps in your site and add an item in list1 and then go to list2 and you will able to see the lookup value to list2 as a column1 field.


You May Also like the Following SharePoint Online Tutorials:

About Navneet Singh

I am Navneet Singh, Working at C3it software solutions pvt. ltd. in Pune. My core skills are SharePoint 2013, Office 365, SharePoint 2010, SharePoint Designer, SharePoint Designer Workflow, Nintex Workflow, Infopath, Webpart, CSOM/SSOM, Power-shell, C#, ASP.NET and SQL Server.

View all posts by Navneet Singh →

Leave a Reply