May 20 2022 02:28 AM - edited May 20 2022 02:47 AM
On a sharepoint list on a modern site there is a single text field with the following data :
test~substring
I have added the below JSON to format this column to show the text 'test' but the substring does not seem to be recognised and I only see the text from within the substring :=substring(@currentField, 0, indexof(@currentField,'~'))
Can anybody please help with this behaviour
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "span",
"txtContent": "=substring(@currentfield, 0, indexof(@currentfield,'~'))",
}
May 20 2022 05:12 AM
@lbrown1375 there's an incorrect comma at the end of the txtContent line. And indexOf needs a capital O.
Try this:
May 20 2022 06:38 AM