Skip to content
This repository was archived by the owner on Jan 19, 2021. It is now read-only.
This repository was archived by the owner on Jan 19, 2021. It is now read-only.

Set-PnPListItem does not save multiple Person values correctly #1096

@bpkennedy

Description

@bpkennedy

Reporting an Issue or Missing Feature

Set-PnPListItem should take a hashtable of values for saving multiple Person values on an item. Documentation for using Person/Group says:

Person/Group (id of user/group in Site User Info List or email of the user, seperate multiple values with a comma): -Values @{"PersonField" = "user1@domain.com","21"}

I took this to mean that you could EITHER use the userID from Site User Info List OR the email of the user. My use case requires adding users that may have never visited the site collection, so I use emails.

Expected behavior

When I send this command I expect 5 values to be created in the Approver (Person) field:

 Set-PnPListItem -Identity $item -List "docs" -Values @{"Approver" = "Alex.Lindemann@dev.wwt.com","David.Mitchell@dev.wwt.com","Brian.Kennedy@dev.wwt.com","Stacie.Weffelmeyer@dev.wwt.com","Julie.Nelson@dev.wwt.com"} -SystemUpdate:$false

Actual behavior

The only users that get saved are Alex, Brian, and Julie (in that order). However, if I duplicate each email the all 5 people save correctly:

 Set-PnPListItem -Identity $item -List "docs" -Values @{"Approver" = "Alex.Lindemann@dev.wwt.com","Alex.Lindemann@dev.wwt.com","David.Mitchell@dev.wwt.com","David.Mitchell@dev.wwt.com","Brian.Kennedy@dev.wwt.com","Brian.Kennedy@dev.wwt.com","Stacie.Weffelmeyer@dev.wwt.com","Stacie.Weffelmeyer@dev.wwt.com","Julie.Nelson@dev.wwt.com","Julie.Nelson@dev.wwt.com"} -SystemUpdate:$false

Steps to reproduce behavior

Try one of the commands above on an item in a document library with a Person column called "Approver"

Which version of the PnP-PowerShell Cmdlets are you using?

  • PnP PowerShell for SharePoint 2013
  • PnP PowerShell for SharePoint 2016
  • PnP PowerShell for SharePoint Online

What is the version of the Cmdlet module you are running?

2.18.1709.1

How did you install the PnP-PowerShell Cmdlets?

  • MSI Installed downloaded from GitHub
  • Installed through the PowerShell Gallery with Install-Module
  • Other means

Metadata

Metadata

Assignees

Labels

status:trackedTriaged and are being investigated further

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions