Setting UserDisplayOptions #1260
-
We are currently using PnP Powershell to set UserDisplayOptions for a field:
Is there a way to accomplish this in the PnP Core SDK? I can find the UserDisplayOptions property in /src/generated/SP/Internal/FieldUser.cs class and its corresponding interface, IFieldUser.cs, but I cannot find it in the SDK source code. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@ajcaterino : did you check if that property is the field SchemaXml properyt? If so, you can update the field SchemaXml and save it. |
Beta Was this translation helpful? Give feedback.
@ajcaterino : load the list field you want to update, read the SchemaXml property of that field (https://pnp.github.io/pnpcore/api/PnP.Core.Model.SharePoint.IField.html#PnP_Core_Model_SharePoint_IField_SchemaXml) and add/update the
UserDisplayOptions="NamePhoto"
element to the XML and then save it back (see https://pnp.github.io/pnpcore/using-the-sdk/fields-intro.html#updating-site-and-list-fields). The resulting field SchemaXml can look like this: