SP.FieldLookup.lookupField property (sp.js)

Gets or sets a value that specifies the internal field name of the field used as the lookup values.

Applies to: apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013

var value = SP.FieldLookup.get_lookupField ()
var value = SP.FieldLookup.set_lookupField ()

Return value

Type: String

Remarks

After you add a lookup field to a list's collection by calling the SP.FieldCollection.addDependentLookup method, you should retrieve the lookup field from the collection and identify the source field in the target list by setting the SP.FieldLookup.LookupField property. When you set the LookupField property you must call the SP.Field.Update method for changes to take effect in the database.

The target of the LookupField property must be one of the following field types:

  • SP.FieldType.Counter

  • SP.FieldType.DateTime

  • SP.FieldType.Number

  • SP.FieldType.Text

In addition SP.FieldType.Computed is allowed as a target if lookups are enabled. For more information, see the enableLookupproperty of the SP.FieldComputed object. The SP.FieldType.Calculated field type can be a target if the output is text. For more information, see the OutputType property of the SP.FieldComputed object.