Open PedroMordeP opened 4 years ago
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Hey @PedroMordeP,
I just found out you can actually insert the group id in the field parameter and it works! I was able to populate my People field with my 'Site Members' group that way. If you don't know your group's id, you can go to Site Settings > People and Groups. Once you select a group, you can see the parameter MembershipGroupId=
I don't know if this behavior is intended or not, and I believe it could still be improved, though.
Funny enough, I think i stumbled on another bug while trying to debug yours. If I use the 'Add-PnPDataRowsToProvisioningTemplate' on a list that has a People field, I get an error. Something like 'the property has not been initialized'. Can you confirm if you are having this issue, too? I am on the latest release btw.
Let me know if you need any help.
Thank you for the test and the result, I will test it too with the ID but if I apply the template on a different tenant the id will not be the same!! So I wanted to use only the name, not sure if this will be possible.
About the 'the property has not been initialized' didn't get this error on my tests.
Reporting an Issue
Using Add-PnPDataRowsToProvisioningTemplate to add to the template xml the content of a list with a field of type "Person / Group":
<pnp:DataValue FieldName="TargetUsers">i:0#.f|membership|test@test.onmicrosoft.com</pnp:DataValue>
What can I do to fix this? is something on my Group?
Expected behavior
Should add to that field the group ? or the user inside that group?
Actual behavior
When trying to add the data it gives and error "Microsoft.SharePoint.Client.ServerException: User cannot be found"
Steps to reproduce behavior
Have a list with a field of type "Person or Group" Add to that field a Group Using Add-PnPDataRowsToProvisioningTemplate to add data rows to the XML
Which version of the PnP-PowerShell Cmdlets are you using?
What is the version of the Cmdlet module you are running?
PnP PowerShell for SharePoint Online 3.20.2004.0 or other below
How did you install the PnP-PowerShell Cmdlets?