Freigeben über


SharePoint: Quick Edit – The user does not exist or is not unique

Consider the following scenario:

You have a SharePoint 2013 or 2016 web application that has both Windows and Trusted Provider / SAML authentication (ADFS, etc) enabled.

You have a list with a "Person or Group"-type (aka: "people picker") column in it.

You edit the list using the "Quick Edit" / "edit this list" functionality to edit the list in a datasheet-style view.

You search for a user account in the Person or Group column and it resolves correctly:

 

You hit enter to go to the next row and you get an error on the first row that says: "The user does not exist or is not unique".

This seems very odd since you just, seconds before, successfully resolved that to a single user account.

Note: This may only occur for users not already added to the site collection. More on that later…

 

So why does this happen?

When you hit enter to go to the next row, the "Quick Edit" control tries to update the list item. It must re-resolve the user that you entered into the People Picker column.

It does so using the users email address. It calls into all available claims providers including Active Directory and your Trusted Provider, which both return results.

That's why we get the "The user does not exist or is not unique" error.  We did not get a single unique result.

 

Solutions:

This one does not have an ideal solution at the moment.

It only occurs when there are multiple authentication providers enabled on the web application, and only when using the "Quick Edit" control, so if you avoid either of those, you won't see the problem. That's more like "problem avoidance" than a "solution", but I do have a workaround.

Workaround: For the user account that fails to resolve, add them to any SharePoint group or "person or group"-type list column in the site. It doesn't have to be the same list, you can add them anywhere in the entire site collection, and then "Quick Edit" should be able to properly resolve them.

 

Here I'm just using the normal new item form to add my "Test 1" user to my list.

Not only does that work to add the user to the "person or group" column, after doing so, I'm also able to successfully add the same user using "Quick Edit":

Why this works: When the user already exists in the site collection, the "Quick Edit" control still re-resolves the user and gets multiple matches, but it then uses those results to match to the User Information List for the site collection and resolve it to a single unique user account. So all you have to do is use the normal (non-quick edit) new item or edit item forms to add the user to any person or group column. After doing that once, you then should be able to add that same user using the "Quick Edit" view on the same list or any other list in the site collection.

 

 

Technical details:

Note: While I've seen this happen in both SharePoint 2013 and 2016, all my testing was done on SharePoint 2016 at build 16.0.4639.1002.

 

In your SharePoint ULS logs, you'll see something like this:

08/14/2018 09:28:46.95 w3wp.exe (0x18E8) 0x2E70 SharePoint Foundation Resolve ax7nk Medium Found multiple matches for resolution. Web: 'd21a207d-0726-4779-8e8d-c0cb97011805', WebApp: 'null', Input: 'test1@contoso.com', PrincipalType: 'User, SecurityGroup, SharePointGroup', PrincipalSource: 'UserInfoList, MembershipProvider, RoleProvider', MatchCount: '3'. 3ab0849e-e089-e088-a10e-e4e9a4c5effc

08/14/2018 09:28:46.95 w3wp.exe (0x18E8) 0x2E70 SharePoint Foundation General 8kh7 High The user does not exist or is not unique. 3ab0849e-e089-e088-a10e-e4e9a4c5effc

08/14/2018 09:28:46.95 w3wp.exe (0x18E8) 0x2E70 SharePoint Foundation General art2g High ListItemUpdate ExpectedFailure: Microsoft.SharePoint.SPException: The user does not exist or is not unique. ---> System.Runtime.InteropServices.COMException: The user does not exist or is not unique. at Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bPreserveItemUIVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bUnRestrictedUpdateInProgress, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback) at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bPreserveItemUIVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bUnRestrictedUpdateInProgress, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback) --- End of inner exception stack trace --- at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bPreserveItemUIVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bUnRestrictedUpdateInProgress, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback) at Microsoft.SharePoint.SPListItem.AddOrUpdateItem(Boolean bAdd, Boolean bSystem, Boolean bPreserveItemVersion, Boolean bNoVersion, Boolean bMigration, Boolean bPublish, Boolean bCheckOut, Boolean bCheckin, Guid newGuidOnAdd, Int32& ulID, Object& objAttachmentNames, Object& objAttachmentContents, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion) at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion) 3ab0849e-e089-e088-a10e-e4e9a4c5effc