0

i want to know the value for ShowInNewForm for a site column, i tried this PnP:-

PS C:\WINDOWS\system32> connect-pnponline "https://***.sharepoint.com/sites/***/" -UseWebLogin
PS C:\WINDOWS\system32> $targetField = Get-PnPField -Identity "ApproverFeedbackandnotesPowerBi"
PS C:\WINDOWS\system32>  Write-Host $targetField.ShowInNewForm

but i did not get any results.. any advice? Thanks

1 Answer 1

2

ShowInNewForm is a nullable property and has no value by default in SharePoint Online.

You will need to update it first to have it return with value. The property can be found in Schema XML once given a value:

Connect-PnPOnline "<SiteURL>" -UseWebLogin
$ctx = Get-PnPContext
$targetField = Get-PnPField -Identity "ApproverFeedbackandnotesPowerBi" -List <ListName>

$targetField.SetShowInNewForm($true)
$targetField.Update()
$ctx.ExecuteQuery()

$targetField.SchemaXml

enter image description here

You can also use API to get the field properties:

https://<SiteURL>/_api/web/lists/getbytitle('<ListName>')/fields

Or

https://<SiteURL>/_api/web/lists/getbytitle('<ListName>')/fields/getbytitle('ApproverFeedbackandnotesPowerBi')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.