Forum Discussion
NMenB
Sep 09, 2022Copper Contributor
NewForm vs EditForm
I have a newform.aspx with 3 fields showing and 12 fields hidden by going in the content type to hide them. How can I show all these hidden fields in editform.aspx?
Thanks.
3 Replies
- NanddeepNachanLearn Expert
Hi NMenB
You can use below PnP PowerShell on each of the field to achieve this.
Connect-PnPOnline <spo-site-url> $ctx = Get-PnPContext $field = Get-PnPField -Identity <field-name> -List <list-name> $field.SetShowInNewForm($false) $field.SetShowInEditForm($true) $field.Update() $ctx.ExecuteQuery()
- NMenBCopper ContributorThank you for your reply. I will try this one out.
- If you just need to show/hide columns, it might be easier to use JSON formatting to hide fields at different times. https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/list-form-conditional-show-hide