Hi, there seems to be a bug in the lookup fields with enabled "Add New" feature.
After adding a new lookup value, the new value is pre-selected on the lookup. But the property fd.field('abc').value is different. I'm missing the fd.field('abc').value.LookupValue there. It becomes available, if I clear and re-pick the lookup.
thx
Alex
Dear @Alex,
Sorry for the delay - that's just how the control works. Looking into workarounds, there should be an option that you could use.
Dear @Alex,
Please, try the following code to get the lookup value with pnpjs:
fd.spRendered(function() {
fd.field('Office').$on('change', function(value) {
if (typeof value === 'number') {
var items = pnp.sp.web.getList('/Lists/Offices').items.getById(value)
.get().then(function(item) {
var lookupValue = item['Title'];
console.log(lookupValue);
});
}
})
});
You need to replace field Name for the Lookup field 'Office', list '/Lists/Offices' and 'Title' with the name of the lookup source field.