pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
987 stars 665 forks source link

Cannot create UserMulti Field from Add-PnPFieldFromXml or Add-PnPField #1716

Open Edward-Adamson opened 5 years ago

Edward-Adamson commented 5 years ago

Notice: many issues / bugs reported are actually related to the PnP Core Library which is used behind the scenes. Consider carefully where to report an issue:

  1. Are you using Apply-SPOProvisioningTemplate or Get-SPOProvisioningTemplate? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/officedev/PnP-Sites-Core/issues.
  2. Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.
  3. If you think that the functionality might be related to the underlying libraries that the cmdlet is calling (We realize that that might be difficult to determine), please first double check the code of the cmdlet, which can be found here: https://github.com/OfficeDev/PnP-PowerShell/tree/master/Commands. If related to the cmdlet, continue reporting the issue here, otherwise report the issue at https://github.com/officedev/PnP-Sites-Core/issues

Reporting an Issue or Missing Feature

Trying to add a Multi User Field. When I try add the Field through Add-PnPField only recognises User as a type, UserMulti does not exist. When I try add the Field through Add-PnPFieldFromXml using Type="UserMulti"the Field is created as a Single user column

Expected behavior

I expect the column to be created as a multi user field

Actual behavior

Column is created as single use field image

Steps to reproduce behavior

My Xml: $xml = '<Field Type="UserMulti" Name="FLD_22" DisplayName="Fld 22" UserSelectionMode="PeopleOnly" />' And query: Add-PnPFieldFromXml -List $listId -FieldXml $xml

https://github.com/SharePoint/PnP-Sites-Core/issues/1023#issuecomment-277198763 Suggests that this should work?

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

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

3.1.1809.0

How did you install the PnP-PowerShell Cmdlets?

Edward-Adamson commented 5 years ago

Bury me, If I add Mult="TRUE" to the Xml it now works!

This blog showed me this: https://techenthusiast.in/2018/06/09/pnp-powershell-working-with-different-types-of-field-using-add-pnpfieldfromxml/

However there is still no way of creating it from Add-PnPField, is this intentional?