Page 1 of 1
Get Lookup value of another column
Posted: 07 Jul 2014
by jcmeyer
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
Re: Get Lookup value of another column
Posted: 08 Jul 2014
by Dmitry Kozlov
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.
Re: Get Lookup value of another column
Posted: 08 Jul 2014
by jcmeyer
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.
Re: Get Lookup value of another column
Posted: 09 Jul 2014
by Dmitry Kozlov
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.