Forum Discussion

Sifiak's avatar
Sifiak
Copper Contributor
Apr 05, 2024
Solved

Help with JSON format and SharePoint Column

I have a simple text column, this stores name and upn in the following format:   firsName LastName <something1@domain>   sometimes its multiple users then it looks like (separated by semicolon a...
  • ganeshsanap's avatar
    ganeshsanap
    Apr 05, 2024

    Sifiak Do you want to show it in one line? I think it is better and easy to show it on separate lines.

     

    Also, you can add additional styling as per your requirements in style property.

    Example: adding margin at the top like: 

     

    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
      "style": {
        "display": "block",
        "margin-top": "5px"
      },
      "elmType": "div",
      "children": [
        {
          "elmType": "div",
          "forEach": "person in split([$TextColumn],';')",
          "txtContent": "=substring([$person],0,indexOf([$person],'<'))"
        }
      ]
    }

     


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Resources