Add new data issue with Lookup field

Hi,

Noticed an issue with the Add New functionality in the SharePoint Lookup control.

I am using the ‘LookupValue’ of the field via fd.field(‘LookupField’).value.LookupValue to get the string selected, however I noticed that when I use Add New feature the value returned is ‘undefined’, if I then change the value of the field it becomes the selected Lookup Value.

I have another field being set by this on a change handler which is how I realised this was happening:

fd.field('Lookup').ready().then(function(){	
	fd.field('Lookup').$on('change',function(){
		fd.field('Other field').value = fd.field('Customer').value.LookupValue;
	});
});

To get the field to be correct I have to Add New, then change the control, and then change it back to the correct value. I presume this must be a bug? This is happening on a Modern Communication site in O365.

Kind regards

Andy

Dear @abolam,

You can retrieve the value of the newly added item by the code:

fd.field('Customer').widget.text();

Hi Alex,

Using .widget.text(), I get a blank value returned after adding the new lookup item rather than ‘undefined’, it still does not provide the Lookup text.

EDIT - but I did notice that when the form saved, the field was populated, is this possibly because the target field is trying to see the new field before the control is ‘ready’ ?