Create a drop-down list with a lookup to another site

April 25, 2008 at 3:22 pm 4 comments

I came across a post in the SharePoint University forum asking for help on creating a lookup to data on another site. I’ve been meaning to create a post on this for a while because this is a very important skill when creating web applications in SharePoint.

Let’s assume that you have a form – editform.aspx. That form already has a Single Item Input Data View setup on it. But now you want to add a drop-down with a lookup AND you want the lookup to pull data from another location.

  1. Start by creating a new row in the table to hold the drop-down.
  2. Click in the empty cell and then click on the datasource you want to perform the lookup on. (Note: you can use any datasource – Connect to another library, Connect to a linked datasource, etc.)
  3. From the drop-down, select Insert as Data Source Control. SPD inserts a grey block in the cell labelled “SQLDataSource – Some weird auto-generated ID”.
  4. On the File Menu, click Insert > ASP.NET Controls> Drop-down list. When SPD inserts the drop-down control it will say “Unbound”.
  5. Hover over the newly inserted drop-down list, and click on the Common Drop Down Lists Tasks flyout.
  6. Select Choose Data Source.
  7. From the Data Source Configuration Wizard dialog, select the datasource we inserted earlier from the Select a datasource drop-down.
  8. Select the Data field to display in the drop-down (what the user will see).
  9. Select the Data field for the value (what sharepoint will store in the field).
  10. Click OK.
  11. The drop-down list should now update to “Bound”.
  12. Save everything.

You now have a drop-down list that performs a lookup from any datasource you can create. I don’t think this will work across different site collections – someone let me know?

Advertisements

Entry filed under: SharePoint Designer, Web Application. Tags: , , , .

Defaulting a Hidden Field on a Form Cascading Drop-down Lists in a parent, child relationship

4 Comments Add your own

  • 1. ThiNg  |  April 30, 2008 at 2:27 pm

    I was asked in the forum, at SharePoint University, how to get this method to save the item in the list. I checked back in the form I used it in and I took that field out – but I think it may have involved some custom javascript. SharePoint’s commit button doesnt seem to recognize the added fields (in fact, you can’t select the value from a workflow either). I will update as soon as I figure out how I did this.

    Sorry in advance for teasing you with the partial solution.

    Reply
  • […] Create a drop-down list with a lookup to another site […]

    Reply
  • 3. Daizy  |  June 3, 2008 at 10:58 am

    Thanks!

    Saved lot of my time

    Reply
  • 4. Vadim Dzyuban  |  April 15, 2009 at 6:51 pm

    Sharepoint lookup field mapping to a remote lookup list

    Doing research and experimenting with a lookup field I’ve found that a lookup field (a site column which gets their data from a list) and a lookup list (from which a lookup field gets their data) must belong to the same site (or different sites if sites are a parent and child) within a site collection. There are also the cross-sites lookup field solutions where a lookup field and a lookup list might belong to different sites but again within the same website/site collection. All these known implementations do not allow separate a lookup field and a lookup list meaning to have them on different web applications and working together.
    Is this correct or am I missing something?

    There might be another scenario where a lookup field should be deployed on a few hundred client’s sites and these clients’ lookup fields must get their data from a remote lookup list being resided on separate admin web application. In this case remote lookup list might be maintained at one central place (admin web app) and feeds updated data for all clients’ lookup fields. The point here is to avoid creation of hundreds instances of a remote lookup list on the clients’ sites. Client sites’ lookup fields should map directly to a remote lookup list being resided on separate admin web application.
    Any idea, advise, discussion or references about a lookup field mapping to a remote lookup list implementation using CAML/C#/webservices will be appreciated.

    Thanks.
    Vadim.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Top Posts


%d bloggers like this: