Get Lookup value of another column

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
jcmeyer
Posts: 4
Joined: Mon Jul 07, 2014

07 Jul 2014

I have a list with 3 columns:

FileNumber, ContactPerson, City

FIleNumber is unique



In another list I have a lookup column on 'FileNumber'. I want to pass the value of column ('City') to a variable after selecting the associated FileNumber. I will then set the value of City in the new form automatically onChange to FileNumber lookup.


I can get the record ID of the lookup using fd.field('Lookup').value

I can get the text of the lookup (FileNumber) using fd.field('Lookup').control('getSelectedText');

Is there any way I can get the text of City after selecting a FileNumber in the lookup?

Thank you

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

08 Jul 2014

Hi,

Unfortunately, you cannot retrieve additional columns of a lookup value dynamically. But you can try our Cross-site Lookup column that allows to request additional column and save them into a hash-table inside the 'Item format' function. Next you can get all these columns by the selected key value on a form via JavaScript.

jcmeyer
Posts: 4
Joined: Mon Jul 07, 2014

08 Jul 2014

as an alternative I can return additional columns with the standard sharepoint lookup and display the additional columns in another form. The user must select the related item from a lookup dropdown and submit to see the changes.

I have tried adding a button with the following onclick event as described in another forum post, but it does not seem to be working; basically I want to submit the form but not close the form (New or Edit form).

fd.sourceFormParam(decodeURIComponent(window.location.href));
return true;

Is there anything else I need to add to the onclick event to submit and return to the same form? or, any way to show the values of the additional lookup columns once the primary lookup dropdown is selected?

thank you very much.

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

09 Jul 2014

Hi,

Please, read the following post to get information on how to redirect users to the edit form right after creation of an item:

http://spform.com/forms-designer- ... sharepoint

With regard to the edit form, you can place a new save button in addition to the existing ones called 'Save without closing' and put the following code into its OnClick handler:

Code: Select all

fd.sourceFormParam(decodeURIComponent(window.location.href));
return true;
More info:
http://spform.com/office-365/cust ... oint-forms

If it doesn't work for you, please, send HTML-source of your form page to support@spform.com.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests