Sharepoint List Multiline Text Column only showing a specific section

rvc251 1 Reputation point
2022-03-14T16:58:15.683+00:00

Hello,

I want to show only a specific section of the multiline Text. I thought about using a ";" to be the signal for a JSON code.
Exp for the Text inside the Column:

"Need more details
edit the view of...
;
Well Done "

It Should show "Well Done"

Is it even possible to do it with JSON code and if then how ?
I Think It would be easier than manipulating this via Power automate

Thanks a lot and best Regards

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,827 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Echo Du_MSFT 17,181 Reputation points
    2022-03-15T06:59:49.647+00:00

    Hello @rvc251 ,

    Welcome to Q&A Forum!

    You can use indexOf() and other string functions to work with strings in JSON formatting as described in this article.

    Please follow this steps:

    1.This is a Multiple lines of text column named [Test Multi-Line Text]

    183184-1.jpg

    2.Here is an example to display value based on your requirement. Displays Well Done if the text contains the "Well Done".

    {  
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",  
      "elmType": "div",  
      "txtContent": "=if(indexOf(@currentField,'Well Done')> 0,'Well Done','@currentField')",  
      "style": {  
        "font-size": "1.12em"  
      }  
    }  
    

    183153-2.jpg

    183185-test3.gif

    Thanks,
    Echo Du

    ======================================

    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.


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.