Home › Forums › Classic DFFS › Single Select People fields allowing multiple values
Tagged: People fields
- This topic has 1 reply, 2 voices, and was last updated 4 months, 4 weeks ago by
Alexander Bautz.
-
AuthorPosts
-
-
July 10, 2025 at 21:21 #38741
We have a very complex classic DFFS form that has a people and groups field set to only allow one person. The field is named “CB Contract Signer” (FIN: ThirdPartyContractSigner). The field is misbehaving and allowing more than one name to be entered. Although attempting to save the form sometimes returns the focus to the misbehaving field where a red error message states “You can only enter one name”, some users have been able to proceed to another tab on the form and save the form without removing the second or third person. Is there some code we can add to the form that would immediately delete the first name in the field if a second name is added? This appears to be the behavior of that kind of field in a native SharePoint form. I’m attaching a screenshot showing two names in the field with the error message below.
Attachments:
-
July 11, 2025 at 08:33 #38743
The behavior you describe is how all single choice people pickers work, but the form should show this error and not allow saving. The validation of the field is done after the postback so it may look like it saves because the page reloads, but the for does not actually save.
If you however have some kind of custom js or maybe are sending out emails using DFFS, these would be triggered on the save attempt.
You can try adding this to your forms Custom JS:
function ensureOnlyOnePP(fin){ setInterval(() => { const arr = spjs.utility.getFieldValue({"fin": fin, "key": "loginname"}); if(arr.length > 1){ // Clear unresolved users document.querySelector("#dffs_" + fin).querySelector(".sp-peoplepicker-editorInput").value = ""; // Clear field setFieldValue(fin, ""); // Set first value in array setFieldValue(fin, arr[0]); } },1000); } ensureOnlyOnePP("ThirdPartyContractSigner");Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.
