Question

I have two lists, A list looks like this: enter image description here

I want the B list to display those values and in NewForm.aspx I would be able to lookup those values either by the code or by the name. B list: enter image description here NewForm.aspx: enter image description here

The both fields should have relationship: if I choose item code, the name changes to the name of that code and vica versa - if I choose name, the item code changes to the code of that name.

Any ideas on how to achieve this?

Thank you.

Was it helpful?

Solution

Teylyn is correct - a lookup definition can't be changed on the fly.

There is one way you can do this, if the reason you are doing this is you need to see both code/name at the same time. On List A, I'd create a calculated column, call it something like Lookup Title, and concatenate your name and code fields. If you want your lookup to be alpha by name, then something like

=[Title]&" - "&[Code]

should work.

In List B, create your lookup column to List A, but use your new calculated field as the 'in this column'. You can't change the dropdown order, but if you create your calculated field correctly, being able to see the codes and names at the same time should help.

You can also pull in the individual columns as additional columns if you want to see them separately on a view.

OTHER TIPS

This is not possible out of the box. You can create a lookup column to a different list, but you have to determine ONE key column that serves as the main lookup column. Then you can select other columns that will bring back values from other columns.

But you cannot switch back and forth between different "main" columns.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top