Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharepoint LookUp field on Choice field?

How to create a lookup field for the Choice field..For eg: In a list i have Choice field and i have to create an lookup column in other list pointing to this choice field ..When i select this list this column is not appearing in the dropdown...Please let me know if there is any Limitation for that

like image 535
Govind Avatar asked Sep 23 '11 05:09

Govind


People also ask

Can you lookup a Choice column in SharePoint?

You can use lookup columns in SharePoint that consume values from other lists or libraries. When using such columns as a field in a canvas app, you can use a drop-down list with choices. To use the choices in a drop-down list, you have to use the function choices.

Can we use lookup column in calculated field?

@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.

How do I use Choice columns in SharePoint?

Create any list within SharePoint and create a “Choice” column. Name your column and add the choices that a user can select from. Once your column has been added, click on the drop-down arrow next to column header to bring down your options. Select “Column Settings” and then “Format this column”.


2 Answers

It is not possible to create a lookup field for a choice (dropdown) field. There are two ways to resolve your problem: The programmatic approach and the workaround.

The programmatic approach involves an creating event receiver to do the magic - pretty work intensive. But there is an explanation here:

  • Sharepoint 2010 - How to use List Events to Set a Column's Value using Visual Studio 2010 (C#)

You can also just create another list, containing your choice field values and use a calculated field as a source for your lookup column. Check out the following explanation:

  • Using a lookup field on a choice field workaround
like image 166
Dennis G Avatar answered Nov 12 '22 09:11

Dennis G


the programmatical Solution is at risk to run into an endless recursion:

The ItemAdded Event and UpdatedEvents are asynchrone. This means, that the command: this.EventFireingEnabled = false is not threadsafe. After systemUpdate you set EventFireingEnabled to true.

But because the ItemUpdated is asynchronus, you cannot guarantee, that the ItemUpdated for your system.update has already been called at this time!.

like image 42
Michael Avatar answered Nov 12 '22 07:11

Michael