No update in sharepoint list after person field change

Hi,

I have an unexpected comportment in my form save (fd.save)

When i modify a standard sharepoint field in my form, update is OK

when i modify a changement in sharepoint person field, field is shown with good value but save dont keep my mupdate in sharepoint list item !

example :

if (fd.isValid)
{
fd.field('TextField').value="...Text"; // OK
fd.field('PersonField').value='my name'; // KO not updated in list
fd.save();

}

My method / syntax is incorrect ? I have applied

https://plumsail.com/docs/forms-sp/javascript/fields-sp.html?highlight=extrafield%20person#person-or-group

thanks for your help

Christophe

Dear @Christophe,
The code is correct, it's just that there is not enough time for the field value to change before the form is saved and closed. Try it like this, for example:

if (fd.isValid){
  fd.field('TextField').value="...Text"; // OK
  fd.field('PersonField').value='Nikita Kurguzov';
  fd.field('PersonField').$on('change',function(){
    fd.save();
  });
}