2

When using SharePoint Online Libraries in modern experience, the edit form for documents is usually shown as a panel to the right.

I found out, that adding a Document Set content type to this library, changes the edit form for all content types to the classic version.

Is this unavoidable (because maybe there only exists one edit form) or can I somehow set the edit form for documents to modern, while using the classic one for document sets?

Or is it even possible to use the modern edit form for document sets too?

Thank you for your help!

3
  • Try the PnP PowerShell script given here and let me know if it works for you: pnp.github.io/script-samples/spo-document-sets-modern-new-form/…. I will advise you to try it on testing document library first and then on live/production document library. Commented Nov 22, 2023 at 5:14
  • 1
    Applying this script to the document set content type within the library solved the problem for all content types. You are a genius, thank you very much!!! Commented Nov 22, 2023 at 11:37
  • Great, glad it worked for you. Commented Nov 22, 2023 at 11:57

2 Answers 2

1

You can enable the modern properties forms for Document sets content type in SharePoint Online document library using the PnP PowerShell script.

Example:

# SharePoint online site url $siteUrl = Read-Host -Prompt "Enter your site url (e.g https://<tenant>.sharepoint.com/sites/contoso)"; # Connect to SharePoint Online site Connect-PnPOnline -Url $siteUrl -Interactive # Get the doclibs on the site $lists = Get-PnPList | Where-Object {$_.BaseTemplate -eq 101} # List the document libraries foreach($list in $lists){ Write-Host "[$($lists.IndexOf($list)+1)] $($list.Title)" } $index = Read-Host -Prompt "Which list to you wish to modernize your content type" # Get the "Folder" content types on the document library $cts = Get-PnPContentType -List $($lists[$index-1]) | Where-Object {$_.Id.StringValue.StartsWith("0x0120")} foreach($ct in $cts){ Write-Host "[$($cts.IndexOf($ct)+1)] $($ct.name)" } $CTindex = Read-Host -Prompt "Which content type to you wish to modernize" # Null out the NewFormClientSideComponentId as that seems to bring it to modern UI $cts[$CTindex-1].NewFormClientSideComponentId = $null; $cts[$CTindex-1].Update($false); Invoke-PnPQuery Write-Host -ForegroundColor Green "All done" 

Source: Enable modern creation forms for Document sets

Note: I will advise you to try this PnP PowerShell script on testing document library first and then on live/production document library.

1

Just want to call out a side effect with this at least for me on several test sites. The order of the document set names get messed up when using this modern form. Example - Document Sets are meant to sit under folders alphbetically. So if in a Library you have a folder called "B Test" and a Document Set called "A Test" the B test folder is meant to be above the A test document set. If you find that the Document set is on top then if you rename the document set by adding a space at the end and then watch at is magically then sits below "B Test". You may never notice this if you only every create manually like this or if you never rename a Document set. But if you use Power Automate to create a Document Set or rename one that already exists they will all fall out of whack.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.