Removal of special characters in a cell in Modern SharePoint Library

%3CLINGO-SUB%20id%3D%22lingo-sub-2379177%22%20slang%3D%22en-US%22%3ERemoval%20of%20special%20characters%20in%20a%20cell%20in%20Modern%20SharePoint%20Library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2379177%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Everyone%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20I%20have%20a%20document%20library%20where%20the%20customer%20wanted%20to%20manually%20create%20indented%20subtasks.%26nbsp%3B%20To%20do%20this%2C%20they%20added%205%20dashes%20to%20specific%20items%20to%20create%20the%20appearance%20of%20indention.%26nbsp%3B%20They%20want%20these%20dashes%20removed%2C%20while%20maintaining%20an%20indention.%26nbsp%3B%20This%20is%20what%20it%20looks%20like%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22SPTEST3_0-1621788632598.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F282980i571D68B5178A5A74%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22SPTEST3_0-1621788632598.png%22%20alt%3D%22SPTEST3_0-1621788632598.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThe%20Title%20column%20is%20just%20a%20single-line%20text%20column.%26nbsp%3B%20I%20want%20the%20bottom%20three%20entries%20(that%20have%20the%20dashes)%20to%20appear%20indented%20under%20the%20top%20entry.%26nbsp%3B%20But%20I%20obviously%20don't%20want%20the%20dashes.%26nbsp%3B%20I%20don't%20know%20if%20this%20is%20a%20JSON%20issue%2C%20or%20may%20a%20power%20automate%20workflow%20to%20get%20rid%20of%20the%20dashes.%26nbsp%3B%20Can%20I%20change%20the%20font%20of%20the%20dashes%20to%20white%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20just%20not%20sure.%26nbsp%3B%20Any%20help%20would%20be%20greatly%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EChris%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2379177%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EColumn%20Formatting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EJSON%20formatting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Modern%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2381130%22%20slang%3D%22en-US%22%3ERe%3A%20Removal%20of%20special%20characters%20in%20a%20cell%20in%20Modern%20SharePoint%20Library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2381130%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1061141%22%20target%3D%22_blank%22%3E%40SPTEST3%3C%2FA%3E%26nbsp%3BI%20really%20don't%20think%20this%20is%20possible%20in%20the%20way%20your%20client%20wants%20it.%20There's%20no%20concept%20of%20sub-items%20and%20so%20anything%20you%20do%2C%20for%20example%20JSON%20formatting%2C%20will%20imact%20the%20first%20one%2C%20SD100%20-%20Smithsonian%20Directives%2C%20in%20the%20same%20way%20as%20all%20the%20others.%20A%20flow%20in%20Power%20Automate%20can%20be%20used%20with%20the%20replace%20action%20to%20remove%20the%20dashes%20but%20it%20will%20not%20leave%20the%20space%20they%20took%20up.%20And%20you%20can't%20turn%20the%20dashes%20only%20to%20white%20-%20all%20the%20text%20will%20change%20to%20white.%20The%20Microsoft-provided%20way%20for%20doing%20this%20sort%20of%20stuff%20is%20to%20have%20a%20folder%20for%20SD100%20-%20Smithsonian%20Directives%20and%20each%20of%20the%20other%20%22top%20level%22%20titles%2C%20and%20then%20put%20all%20the%20documents%20related%20to%20each%20one%20in%20the%20appropriate%20folder.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERob%3CBR%20%2F%3ELos%20Gallardos%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%20color%3D%22%23006400%22%3EIntranet%2C%20SharePoint%2C%20Website%20and%20Power%20Platform%20Manager%20(and%20classic%201967%20Morris%20Traveller%20driver)%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi Everyone,

 

So I have a document library where the customer wanted to manually create indented subtasks.  To do this, they added 5 dashes to specific items to create the appearance of indention.  They want these dashes removed, while maintaining an indention.  This is what it looks like:

 

SPTEST3_0-1621788632598.png

The Title column is just a single-line text column.  I want the bottom three entries (that have the dashes) to appear indented under the top entry.  But I obviously don't want the dashes.  I don't know if this is a JSON issue, or may a power automate workflow to get rid of the dashes.  Can I change the font of the dashes to white?

 

I'm just not sure.  Any help would be greatly appreciated.

 

Thanks!

 

Chris

2 Replies

@SPTEST3 I really don't think this is possible in the way your client wants it. There's no concept of sub-items and so anything you do, for example JSON formatting, will imact the first one, SD100 - Smithsonian Directives, in the same way as all the others. A flow in Power Automate can be used with the replace action to remove the dashes but it will not leave the space they took up. And you can't turn the dashes only to white - all the text will change to white. The Microsoft-provided way for doing this sort of stuff is to have a folder for SD100 - Smithsonian Directives and each of the other "top level" titles, and then put all the documents related to each one in the appropriate folder.

 

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

 

 

@RobElliott 

 

Thank you very much for your reply.  It's definitely a weird request for sure.  I have this JSON formatting that works to remove the dashes:

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "children": [
    {
      "elmType": "span",
      "style": {
        "padding-left": "=if(@currentField startsWith '----', '25px',''"
      }
    },
    {
      "elmType": "span",
      "txtContent": "=replace([$FileLeafRef],'----','    '"
    }
  ]
}

 This works to remove the dashes.  However, it also removes the indent.  I'm hoping to just remove the dashes, and maintain the indent.  I don't know if it's possible to format specific cells like that though.