Forum Discussion

Sturberg's avatar
Sturberg
Copper Contributor
Dec 02, 2022

How to remove the document extension the end of the name column?

Hello, 

I would like to remove the extension at the end of the doc name? 

It could even be in a calculated field. Any idea? 

Also, when I add a doc lib on a page, the column that contains the name of the document is too narrow and cut part of the doc name. I tried to add a json format, but it doesn't work on a page. 

 

We are on SharePoint 2019 On Prem 

 

  • RobElliott's avatar
    RobElliott
    Silver Contributor

    Sturberg normally you would format the column with the following JSON, but I don't know if that's possible in SP 2019 On Prem.

     

    {
       "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
       "elmType": "div",
       "txtContent": "=if(indexOf('@currentField','.') > 0,substring('@currentField',0,indexOf('@currentField','.')),'@currentField')"
    }

     

    Rob
    Los Gallardos
    Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)

      • Teerice's avatar
        Teerice
        Copper Contributor

        Sturbergyes you can. Right click on the column, select Column Settings > Format This Column, then click on Advanced Mode and paste in your Json code.

Resources