Format Column in SharePoint List

Aleyna Sahin 21 Reputation points
2022-09-15T10:38:21.35+00:00

hello i have a lookup Column in my sharepoint list.
first list "Event" second list "Participants"

the second list is lookup field with the name and the additional field is the last name.
What bothers me here is that the last names are listed next to one another and not one below the other as with the first name.
The email addresses should also be one below the other and not next to each other.

I want to format it with JSON, can someone help me.

i add a screenshot, from my table.
241461-image.png

thank you in advance

Microsoft 365 and Office SharePoint Server For business
Microsoft 365 and Office SharePoint Development
Microsoft Security Microsoft Graph
{count} votes

Accepted answer
  1. Jing Sun_MSFT 956 Reputation points
    2022-09-16T05:58:57.373+00:00

    Hi @Aleyna Sahin ,
    Per your description, you could have a try on the JSON code below
    For lastname column:

    {  
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",  
      "elmType": "div",  
      "txtContent": "=replaceAll(@currentField,',','\n')"  
    }  
    

    For email column:

    {  
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",  
      "elmType": "div",  
      "txtContent": "=replaceAll(@currentField,';','\n')"  
    }  
    

    Before:
    241718-image.png
    Test Result:
    241763-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.