How to get field value from the additional lookup fields?

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
eedoh
Posts: 37
Joined: Tue Feb 11, 2014

11 Mar 2014

Here's the example... I have a list, let's call it "The List". In The List I have a column called "The Column" and it's of Lookup type. The Column is a lookup to "The List2" list, particulary the Name field, but it also has additional field selected from the same list (The List2), ID field for example.

I have no problems selecting "The Column" field value on "The List" form
var TL2Name = fd.field('The_x0020_Column').control().value();

In the other hand, every time I try to read the value from "The Column:ID"
var TL2ID = fd.field('The_x0020_Column_x003a_ID').control().value();
I get "undefined" value, although I'm using correct internal name.

Is there a way around this?

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

12 Mar 2014

Hello,

First, you should place the additional column onto your form. Then you can use the following code to get its value:

Code: Select all

fd.field('The_x0020_Column_x003a_ID').control()._el().text()
Please, note, that the values of additional fields are loaded only after the form saving.

eedoh
Posts: 37
Joined: Tue Feb 11, 2014

12 Mar 2014

It worked. Thanks

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 23 guests