1

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. 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!!!
    – Martin Z
    Nov 22, 2023 at 11:37
  • Great, glad it worked for you. Nov 22, 2023 at 11:57

1 Answer 1

0

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.

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.