Populate external lookup column

Hello,

I am using the modern ui version of Plumsail Forms for SP2019 on prem. I have a list that has a lookup column from an external list(that gets some data from an Oracle db).

It looks like the field is not supported in modern forms so I just put a textbox with a type ahead functionality that uses pnp js to get the data from the external list.

Is there any method to tie the data I am getting to the lookup column? Perhaps on beforeSave event...

Many thanks,
Adrian

Dear @Adrian_Ganea,
You can just write code that will automatically copy the value to another field, though I am not sure it will work with External Lookup field type, so I'll give an example with Title field instead:

fd.spRendered(function(){
  //update field on form load
  fd.field('YourTextbox').value = fd.field('Title').value;
  
  //update sharepoint field on field change
  fd.field('YourTextbox').$on('change',function(value){
    fd.field('Title').value = value;
  });
});

The lookup field needs the ID to be set.

Thanks, Nikita, but unfortunately it is not working.
I tried to set just a static ID(that is present in my external list) no javascript error is triggered but the value is not saved.
I will have to look into some other option, perhaps not use a lookup field and just store it as a simple value.

Kind regards,
Adrian

1 Like