Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharepoint: Calculated column based on another list

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?

like image 991
jaycee Avatar asked May 28 '11 21:05

jaycee


People also ask

How do I add a conditional column to a SharePoint list?

Go to your SharePoint Online list >> Open the New Item form by clicking on the “New” button in your list. On the New item page, click on “Edit Form” button and then “Edit Columns” as in the below screen. Now, on the “Edit Columns” form, click on the three dots (:) and choose “Edit Conditional formula” from the menu.

Can you use a calculated field in another calculated field?

Unfortunately you cannot refer to calculated fields when creating a new calculated field.

Can you use a lookup column in a calculated column SharePoint?

Re: SharePoint List calculated column formula using a Lookup column reference. @jasenpeters you can't reference a lookup column in a calculated column formula. You could use a flow in Power Automate to create the ReportNumber and display that in a single line of text column.


1 Answers

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!

like image 160
Eric Herlitz Avatar answered Oct 13 '22 13:10

Eric Herlitz