This project has moved. For the latest updates, please go here.

Clearing a value using SetValue for People and Group fields

Jul 21, 2014 at 7:14 AM
I am using SPUtility to initialize my default EditForm page. For my solution, I am required to clear any document properties when a new document is uploaded. I have just about everything working as needed, except the person / group fields. When I try to clear these values, the following error is thrown:
Unable to get property 'msie' of undefined or null reference.

I have tried each of the following approaches (the first two work great on all of the other data types) and get the same error.
field = SPUtility.GetSPField('Requestor').SetValue();
field = SPUtility.GetSPField('Requestor').SetValue('');
field = SPUtility.GetSPField('Requestor').SetValue(';');

Any advice would be appreciated.

Jul 22, 2014 at 12:02 AM
People fields have given me a lot of trouble so unfortunately I don't have a good way to do what you want. The implementation varies a lot between the different versions of SharePoint so I haven't been able to get anything reliable working... especially in SharePoint 2013.

If you are OK with writing your own jQuery/JavaScript you might be able to get something working. You could reference some of the code I attempted already by looking at SPUtility's source code:

Sorry that isn't much help.
Jul 22, 2014 at 11:35 PM
Found the following code which clear the value like a champ at

frankok May 30, 2013 at 2:24 PM
To clear a people picker field, do this the old way:
// There's no easy way to find one of these columns; we'll look for the comment with the columnName
var searchText = RegExp("FieldName=\"" + columnName + "\"", "gi");
// Loop through all of the ms-formbody table cells
$("").each(function() {
// Check for the right comment
if (searchText.test($(this).html())) {
$(this).find("div[Title='People Picker']").html("");
$(this).find("textarea[title='People Picker']").val("");
$(this).find("img[Title='Check Names']").trigger("click");

return false;
Good enough for me.
Jul 23, 2014 at 2:18 AM
Great! I'm glad you were able to get it working.