Forum Discussion

_J-K_'s avatar
_J-K_
Copper Contributor
May 26, 2023
Solved

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...
  • Cedricbob's avatar
    Jan 11, 2024

    _J-K_ 

     

    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.

Resources