Trying to remove all commas from a single line of text SharePoint Online field entries.
Any ideas on how to achieve that, any formatting formulas, or JSON?
Thank you in advance!
SharePoint JSON formatting now supports replaceAll operator which you can use to remove all commas from a single line of text.
Example:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent":"=replaceAll(@currentField, ',', '')" } Reference: SharePoint: Replace All Occurrences of Substring in a String using JSON Formatting
You would need to create an SPFx FieldCustomizer
Essentially you then would write
@override public onRenderCell(event: IFieldCustomizerCellEventParameters): void { event.domElement.innerHTML = `<div>${event.fieldValue.replace(/[,\.]/g, "")}</div>`; } or whatever modifications you'd want to make.
Field Customizerbe what you'd want?