Sharepoint: Calculated column based on another list

jaycee picture jaycee · May 28, 2011 · Viewed 35.4k times · Source

I could be looking at the wrong way to do this, but here I go:

I have a Sharepoint list (titled "Trips"), which has a list of trips scheduled to particular zones. I have a second list ("Zones"), which has a fixed number of items, each item representing a particular zone. Zones has a column titled "Condition" describing the roads in that particular area.

Now... given that an item in Trips contains a reference to the Zone item where the trip is heading, I want to be able to "look up" the Condition column for that Zone item and include it in Trip views. Problem being, if I add a lookup column to Trips, it only allows me to select the title column from Zones, which is just the zone name.

Any thoughts?

Answer

Eric Herlitz picture Eric Herlitz · May 29, 2011

In SharePoint 2010 (and newer) you can but not SharePoint 2007.

In SharePoint 2007 you have to create a custom input form, check this out http://weblogs.asp.net/jan/archive/2006/11/06/Custom-Edit-Forms-for-SharePoint-2007-Lists.aspx. You can also add them by creating a custom web part, let us know if you need help with that.

In Sp2010 things are much simpler, you simply use the lookup column type (not by calculated columns). You should have the Trips list looking up values in the Zones list as you suggested, when selecting an item from the zones list you can automatically fetch values from other columns in the remote list by checking the boxes in the "Add a column to show each of these additional fields" section.

I made an example I added some items in the Zones list

And a few trips in the trip list, selecting the lookup column from the zones list

And the result, my trip, the zone and the condition of the zone, which is picked up from the zones list

The settings for the lookup

Good luck!