1

Is there any way to rewrite the URL of "Name" column in a document library's modern view?

"Field Customizer" is an option but then I will have to hide/delete "Name" column, which is not a good idea as this will be SPFx extension I need in whole tenant and I cannot remove Name column from the tenant.

Besides that, in search results also, I need to redirect to other page so its better I can rewrite the URL instead.

1

I don't think it would be possible apply spfx extension on name field(certain other columns also) but it does work on FileLeafRef column. Ref link

Column formatting could have been an option but problem is that Name column does on on appear column settings, it just appears in view fields with this 3 columns

Name (linked to document).
Name (for use in forms)
Name (linked to document with edit menu)

Another idea might be to use a calculated field based on name column and using column formatting. But then again search results would again need to be customized using search display template.

Unfortunately, I don't think there would be any work around, because Name column just stores document name and url to document is generated dynamically in all OOTB views(classic and modern view) based on column selected in view. Same case goes with search result, it uses FileLeafRef to generate link to document.

  • Thanks for your comment Siddharth. Thing is, spfx extension will be deployed tenant wide so column formatting is not an option. I need something which will work across tenant without making any more manual changes – Garima Jun 19 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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