Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to add a "person" in a "person field"? #163

Open
reiniertc opened this issue Jul 21, 2020 · 1 comment
Open

how to add a "person" in a "person field"? #163

reiniertc opened this issue Jul 21, 2020 · 1 comment

Comments

@reiniertc
Copy link

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.

@JLauwyck
Copy link

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}'));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants