Forum Discussion
_J-K_
May 26, 2023Copper Contributor
SharePoint JSON Formatting using split and the resulting array
Hello, at https://learn.microsoft.com/de-de/sharepoint/dev/declarative-customization/formatting-syntax-reference I did find this for the split operator: split: divides the given string into a...
- Jan 11, 2024
I couldn't find a way to access the resulting array either.
Like @suvi-15 pointed you can use the substring instead. But in this case, accessing another field requires this markup [$ColumnName] and not the @ColumnName
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "=substring([$Supervisor.email], 0, indexOf([$Supervisor.email],'@'))" }Additional note: I couldn't access a field that has a space in it.
ex.:
[$Supervisor Info.email] doesn't work.
[$SupervisorInfo.email] works.
Cedricbob
Jan 11, 2024Copper Contributor
I couldn't find a way to access the resulting array either.
Like @suvi-15 pointed you can use the substring instead. But in this case, accessing another field requires this markup [$ColumnName] and not the @ColumnName
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"=substring([$Supervisor.email], 0, indexOf([$Supervisor.email],'@'))"
}
Additional note: I couldn't access a field that has a space in it.
ex.:
[$Supervisor Info.email] doesn't work.
[$SupervisorInfo.email] works.