View results for Lookup Field

Hello,

I have followed the guide for setting up the view results of a lookup field https://plumsail.com/docs/forms-sp/how-to/lookup-view.html and it is working really well and provides great functionality, however is it possible to always show the extra detail even once a selection is made?

  1. Drop Down View

  2. Selected View

It would be great if once selected all the additional info remained and also on load if this info was already there?

Thanks

Hello @Tony_Duke,

Unfortunately, this can't be done, but I can suggest two options:

  1. You can add TextBox from Common Fields sections, disable it and set its value on Lookup change with the below code.
fd.field('Lookup').$on('change', function(value) {
   fd.field('TextBox0').value = fd.field('Lookup').value.Title + " " + fd.field('Lookup').value.Description; 
});
  1. You can create a calculated column and design the desired string. Then add the lookup field referred to this column. So lookup field will display desired information in the drop-down and then the value selected.
    image

Hi Margarita

I thought this may be the case, but that's ok, to be honest having thought it through we need to record against this item what the details of the lookup were when the lookup was originally selected not necessarily what the details are at the point of opening so I think my best option is to add additional text fields to the list and then disable and set the values on lookup change, that way in the future if a user opens the item they see what the values were at the point of creation...

Thanks for your assistance though.

1 Like

I am trying to get the onchange event fire for lookup, for some reason its not giving alert,
TestID is a lookup column from second list. below is the code. Also I am trying to get it in new form of master list. Thank you.

window.fd = fd;
fd.spRendered(function(){
alert("Rendered:");
fd.field('TestId').$on('change', function(value) {
if (value) {
alert("dropdown changed");
});
});

never mind its working now, I tweak the code not to check the value. Thank you.

I figured it out. Thank you.

1 Like