Lookup control too long for text field?

Hi all -
I'm using a Plumsail Lookup control to pull in multiple items, and a user reported and error: "Invalid text value. A text field contains invalid data. Please check the value and try again".

The user was able to figure out that she hadd too many options selected in teh lookup control, and was able to clear the error by reducing the number of options (I confirmed it was not a specific item causing the error).

My initial guess is that it's hitting the 255 character limit of the Sharepoint text field it's saving to... please let me know if that sounds inaccurate.

Is there a workaround for this - some way to save the Lookup Control to a multi-line plain text SharePoint field instead of the single-line field, or to expand the maximum character count beyond 255? I am already saving the selected values from the lookup control to a multi-choice field in SharePoint (related post here)

Lookup control (with too many items):


Hello @GGiacomo,

It is a known limitation. We cannot use a multi-line text because it's not searchable and indexable. Currently a workaround is limiting the length of the display value. For instance, you can choose another field with limited length as a display value instead of the title. And show the title only in the search results.

Hi Mararita -
Thanks for the information. I ended up just creating an additional lookup control (UpgradeParts2) with an additional SharePoint string column to write back to, and write both of them back to a SharePoint choice column in SharePoint to consolidate them... functionality you helped me write before =)

fd.spBeforeSave(function(spForm) { // Push lookup upgrade values to Upgrade field
    const selected = [];
    fd.control('UpgradeParts').value.forEach(element => selected.push(element.LookupValue))
    fd.control('UpgradeParts2').value.forEach(element => selected.push(element.LookupValue))
    fd.field('UpgradeOptions').value = selected;

Thanks as always for the help!

1 Like