Create relationship between two lookup columns in a sharepoint list - sharepoint

I have a Sharepoint List 'TeamValues' that defines values that should appear in another list.
TeamValues List:
Title Team Sub-Team
1 A Blue
2 A Green
3 B Yellow
4 C Silver
5 C Gold
I have a list that users can edit and in this list I want to lookup 'TeamValues' list and create a dropdown list for users to select a value from the Team column. This needs to be unique so in this case the values that should appear are: A,B,C
Once they select a value I need a second column to populate a drop down list that users can select E.g. If they select Team: A, then the second drop down should show: Blue, Green as the options.
How can I do this using Sharepoint? I don't have any code access and only have the sharepoint GUI to work with.
Is this possible?
I have created a lookup choice column Team that looks at my TeamValues List however this is showing all values e.g. A,A,B,C,C. I have created a lookup choice column for the subteam that also shows every value. I dont know how to link these together or get a relationship between the two choice drop downs/ remove duplicate values. I tried the following option: 'the Enforce unique values is not displayed.' which did not work
No code applicable

I am sorry to say that but I think there is no OOB functionality to show distinct values of lookup column and to do this kind of relation without any code. I also did some research just to be sure but I could not find anything like that.
If You would consider some code You can always use javascript jsLink technology to achieve this. It's not that hard. It's a JS file that You can add to some lib on sharepoint site and then You can add this JS to webpart manually without any deploy or other. After that with javascript You can overwrite the default behavior of any control/column and do this kind of relation or show only distinct values.

Related

Allow exception for dependent (secondary) data validation

I am trying to make a form that will give users a list of possible defects to choose from when reporting a customer complaint. First they will choose from a list of regions on the product where the problem exists and then they will choose from a list of possible defects which will populate based on the location selected in the first list. I have made the list of regions as comprehensive as possible but I feel that it is likely that something will arise where I have not forseen this issue as a possibility. As such I would like to include an "Other" option in the location drop down list which, when selected, would change the second data entry point from a data validation list to allowing the user to typ anything the user would like to add. Is this possible to have the type of data validation dependent on a condition?
Dependent dropdown lists validation. Reference youtube video one and two
You can mention "Others" option on the top of the source list for the first (Location) validation. You can then add data validation for the first list using named range with offset function. This will allow you to freely add other locations at the bottom of the list.
For the second column validation, you can enter formula skipping the first ("Others") cell in the location list.
In the image below, validation source list for column D is $A$2:$A$10 and validation list formula for Column E is =IF(COUNTIF($A$3:$A$10,$D2)>0,$B$2:$B$10,$E2)

Search formula for best text match among two excel lists

I have a long list of products (+20,000 items) of surgical instruments. Sometimes I receive requests for different names of these products which is impossible to manually match in my list.
I was thinking of a formula to find or suggest the closest result of match for the common words in each cell.
I have created this formula:
=INDEX('Products'!G:G,MATCH((("*"&LEFT(A2,5),'Products'!G:G,0))
(where Products G:G refers to my long list.
it gave some results correctly but more than 80% of the result came back with false results.
please see the attached image to show you the result.
is there is a way I can get more accurate result?
or I was thinking of finding major category of each item such as:
Category 1: Scissors, Retractors, Knives, etc.
Category 2: Straight, Curved, Angeled, etc.
Category 3: Sharp, Blunt, etc.
Category 4: 10mm, 130mm, 24cm, etc. (size)
which is easy for me to do it.
then use the same formula but with referring to the common words..
something like:
=INDEX(Products!G:G,MATCH("*"&LEFT(E2,5)&"*"&F2&"*"&G2&"*",Products!G:G,0))
where E2, F2, G2 refers to the categories..
I tried but it gave false results as well.
I urge you in the strongest sense of the word to spend some time creating a good quality master table and then spinning off 1 table for each category.
make use of clean(), trim(), proper(), heck, if you need to copy the data in notepad++ and enable view all symbols then switch between ansi utf utf8 wtf omgwtf or any other encoding to ensure you dont have any hidden special characters than do it.
you have 4 categories, so that's 4 1 column tables. name them. no duplicates. no trash. no junk. sort your data. nice clean names/words/whatever you categorize by. if you absolutely must add an index or key column then go ahead but do yourself a favor and stop there. use a different table to deepen your relationships.
next step is to to create comboboxes. i'm not sure why but the combobox in excel is not the same combobox in the vba editor. you want the one in the editor. you can make a fancy user form or you can make a minimalist text box design. whatever you fancy. just make sure the combobox has a field for RowSource in the properties. for whatever reason i don't get that option if i am not in the vba editor when i create the box.
you're almost gauratneed to want drawmodal = false on every user form you make for these boxes
you probably really don't need more than 4 boxes but it depends what you're doing so that's up to you. name your combo boxes.
verify each box has: matchentry = 1-fmMatchEntryComplete
i recommend: style = 0 - fmStyleDropDownCombo
this will allow you to begin typing and autocomplete the first match and also let you select from a drop down list, starting with the the first match of the name you've typed.
you can set the number of elements in the list. default is 8. if you have a slow computer than i wouldn't push it much. if you have a best then give it a shot.
you can also change fonts for easier reading and a bunch of other format changes.
now the this is the most important part - RowSource will be one of those 4 tables
now that i've given instructions, let me explain why. some businesses don't have the best practices and i'm currently with one that's using an oracle erp solution for data management but the front end isn't used. data entry is done in excel and loaded into oracle using batches. lookups in oracle continue to be a psychological barrier for the ap/ar teams so i did exactly what i suggested here but took it a few steps farther.
i pulled the vendor master and i pulled teh customer master
i cleaned the data and compiles simple pure clean 1 column tables
then i created a form for the comboboxes
first came ap with vendor name
then vendor number
then vendor remittance location
our orderering facility number
selecting a vendor name populates the vendor number box with the possible vendor numbers. same for remittance location and ordering facility
i pulled a year's worth of transaction data and created a gl table. some vendors have only ever used 1 gl acount. some several. there's a % number next to each gl. that represents the value of transactions posted from that vendor to that gl for the last year.
next up a date picker and text boxes for invoice fields.
get it nice and tight on a form, set the tab stops, add a commit button and all of a sudden we have a front end excel platform that performs better than oracle - because people use
i haven't finished the ar side but it'll get done and i'll the angels will be rejoicing and singing my name for years to come.
1:1 matching with autofill and drop down functionality you can't beat it. that's what you get with my suggestion.
best of luck!

Link items to categories in a list in Excel

The context of my problem is that I have to lists:
One list of categories
One list of items
The number of categories/items in both list can vary, as well as their order in it.
My problem is that I want to implement 2 possible types of actions:
The first action is to be able to assign each item to one or more categories. For example, I am the user of the excel sheet and I want to assign item 3 to categories 1, 2 and 4 (via checkbox or other means).
The second action is to be able to highlight all the items in a category by selecting this category (either select the cell or the category in a dropdown list). For example, is items 1 an 3 belong to category 1, we would have the following results when selecting category 1:
I would like to realize this in an excel spreadsheet with VBA macro. I tried to find technical solutions in order to implement this but without success. Indeed, I would need to link variables to a cell (in order to assign categories to item) but I found no way to do that (classical use of variables and arrays are too restricted for the requirements).
My questions are therefore:
Do you think the proposed application is implementable in excel (potentially with VBA) ?
Do you have ideas of what technical solutions I could use in order to implement it so that I have a starting point to solve my problem ?
You can use excel as a 2-entries array to assign items to categories; then use conditional formatting:
Maybe its too simple for your case, but it can help somebody else.

Excel Match Index for Mutliple Criteria in one cell

I have a spreadsheet which is filled automatically from data in Microsoft Sharepoint. Unfortunately this data fills my location column as follows: IND;# ENG ;# USA if for example that particular input has 3 locations.
I then have drop down boxes (made via data validation) to filter the results down and give an optimum result. However when it comes to choosing location i can either choose ALL, IND, ENG, USA OR IND;# ENG ;# USA. If I chose, for instance, IND, then the options that are in multiple locations will not be returned (only the options that are in only IND will).
I was just wondering if there is any way, avoiding VBA, which will enable a choice of the individual location to return all options in this location, including the options that are availible in multiple locations.
** Please note that these multiple locations are contained within the SAME cell.
It's not possible as you have the question written. A drop down list created by data validation can only display a single result. If you chose 'IND' and wanted to show results for say 'IND' and 'IND, ENG' you would need to use something other than a drop down list or you need to do additional filtering based on the value selected down stream in your code/logic.
I'd say your best bet is to use VBA. This can be transparent from the user. When a user selects a value in the drop down list, vba can sort and filter the remaining drop down list based on what was selected (aka dependent drop downs)

Why my column dont shown under "Add a column to show each of these additional fields"?

In SP2010,
I want to get 2 columns from another list and merge these columns. But while i am trying to do this via Lookup, they dont shown under "Add a column to show each of these additional fields".
But i tried simple text one (not lookup) it shown.
Is there anyway to make it shown which is a kind of lookup field ?
Not all fields are supported as lookup fields. I tried to find a supported fields list but didn't find one. While searching though I ran across this discussion which offers a fix for columns that aren't supported such as choice fields.
http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/5a80988a-6b37-4454-957b-856ea16b2e60

Resources