Forum Discussion
SPTEST3
May 23, 2021Copper Contributor
Removal of special characters in a cell in Modern SharePoint Library
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....
RobElliott
May 24, 2021Silver Contributor
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)
- SPTEST3May 24, 2021Copper Contributor
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.