how to add a "person" in a "person field"?
How do I correctly add a "person" in a "person" field of a sharepoint list? I've tried using the user-id, the full name and the emailadress of the user .
When I enter the person in the list via Sharepoint and than retrieve that list, I see something like:"{number};#{full user name} the number is always the same per user.
I've been able to add 'person' fields as well as 'lookup' fields via the lookup (or magicLookup) function.
If you know the number (I suppose sort of ID?) and name of a person, you can get the correct value to save via $sp->lookup'{number}', '{full user name}').
Full working example:
$sp->write('{List Name}', array('Title'=>'Example item','PersonLookup field'=>$sp->lookup('{number}', '{full user name}'), 'OtherColumnLookupField'=>$sp->magicLookup('{Value}', '{List in which you lookup}'));