How can clear people picker/person field?

good day, how can i clear people picker on save ?
i tried:

 fd.field('Moderator').ready().then(function(field) {
       field.clear();	
    });  	
 fd.field('Moderator').clear();
 fd.field('Moderator').value=''
 fd.field('Moderator').value=null

in form it shows that clears value, but after saving i see in list the value is present.

Dear @ixxxl,
Here's the same code used on a form, should work just fine:


Are you sure you're saving the item after that? Can you record a similar video?

@Nikita_Kurguzov
Hi, Yes it is saving the form
button code

fd.spBeforeSave(function (spForm) {
//fd.field('Moderator').value=null;
 fd.field('Moderator').ready().then(function(field) {
       field.clear();	
    });  	
    fd.field('IDWorkflow').value = "ĂŽnregistrare";
    fd.field('Stare').value = 'ĂŽnregistrare'
	fd.field('SchimbFlux').value = fd.field('Tip_x0020_CMS').value
    return fd._vue.$nextTick();
});
return fd.save();

Dear @ixxxl,
There is no need to use ready in spBeforeSave() as it's already loaded by this point. But it still takes time to update field value, and the save happens quicker.

One solution is to trigger save on field change, like this:

fd.field('Moderator').clear();
fd.field('Moderator').$on('change',function(){fd.save()});
1 Like

@Nikita_Kurguzov
Thank you! now it works!
i put spBeforeSave() because there are some browsers Internet Explorer, which without that didn't save State.