We are using a lookup filter for two fields. The values saved to the column are ID and value {"id":274,"text":"780310"}
I need to just have the text and not ID
I have tried as outlined in the online documentation
fd.spRendered(function(){
fd.control('Cost Center').ready(function(control) {
// returns the selected option as a string:
fd.control('Cost Center').value.LookupValue;
});
});
I have also tried
fd.spRendered(function(){
fd.field('Cost Center').value['Title'].LookupValue;
});
});
Couldn't get either way to work. I am also not a developer - any advice would be appreciated.
Val
Hello @Smilingval,
Welcome to Plumsail Community!
You can save only the disaply value of the control to a general SharePoint single line text field using the code. But in this case, the value of the Lookup control on Edit and Display Forms will be blank.
fd.spRendered(function() {
fd.control('FieldNamer').ready(function(control) {
control.$on('change', function(value) {
fd.field('SharePointFieldName').value = value.LookupValue;
});
});
});
Use the name of teh field and the control in the code:
The SharePoint field must be on the form, and if you want it to be hidden, add a style to it:
display: none;
Thank you for your reply. Will work on it and let you know.
Val
Worked beautifully. Thank you!!
1 Like