Sharepoint Lookup or Calculation

Posted on 2010-01-12
Medium Priority
Last Modified: 2012-05-08
I have two WSS 3.0 lists: one called Issues and a second called Client Table.  In the Issues list, I have a column called Client which stores a company name like "Acme".  In the Client Table list, I have a column called Client and another with the associated Username.  Assuming a 1-to-1 relationship & without doing a lot of coding, is it possible to return the Username to a new column in the Issues list from the Client Table list based on the value of the Client column in the Issues list?  If so, how would I do this?
Question by:Cleartrack
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 26299265
Well, I tried this with content types and using site columns. This does not look possible using OOB site column functionality.

You can either go with the following approaches:
- Make the new column (where you need to pull the user from the Client Table list) and the clients column in the Issue list as lookup columns to pull the user from the Client Table list.
Modify the NewForm.aspx page in the Issue list to have custom javascript to automatically select the username when the user selects the Client from the drp down.

This looks like the simplest way to get this done. But it does require customization.

Another way will be add an event handler to the list.
The event handler should be using ItemAdded method of the SPItemEventReciever class

and in this method, you can add your functionality to collect the data from the Client Table list and match it with the one the user has filled.

You mentioned that there is 1-2 relationship, but using OOB columns, SharePoint is not that intelligent to detect it. Thus, custom event handler needs to be created to have that 1-1 relationship addressed.

Accepted Solution

Joestetz earned 2000 total points
ID: 26303293
You should create a new column in the Issues list called "User" that is hidden. Create a workflow (On Create) for the Issues list that will Set the Field (User) to [Client::Title WHERE Client::Title == Issues::Client]

The above pseudo-code will make sense in the workflow designer within SharePoint Designer.

All you have to do now is make sure the "User" column is displayed in the list view you want to show people. This is also assuming a 1-1 relationship. You will have to add additional workflow on the Client list if you want to keep the Issues list up to date or if you want to account for 1-many relationships.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
When using a search centre, I'm going to show you how to configure Sharepoint's search to only return results from the current site collection. Very useful when using Office 365 with multiple site collections.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question