SahrePoint Online - Multiline Text column not appearing for List validation

Gavin Smith 0 Reputation points
2024-02-12T08:54:08.72+00:00

I have a Multiline column called "Comments" (Rich Text), I'm trying to create a validation rule whereby if a prior column has a certain selected value then this comments column must be filled in. However I noted that the column does not appear on the list of available columns to have a formula added too. Is there a limitation which prohibits Rich Text multi Line columns from being added to a validation rule in SharePoint online?

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

1 answer

Sort by: Most helpful
  1. Ling Zhou_MSFT 16,740 Reputation points Microsoft Vendor
    2024-02-13T02:14:57.44+00:00

    Hi @Gavin Smith,

    Thank you for posting in this community.

    As you can see, SharePoint Online does not support validation rules on Multiple lines of text column at this time.

    But we can implement this validation using JSON formatting. You can try this method to see if it solves your problem.

    1.Open column formatting.

    User's image

    User's image

    2.Copy the following JSON code. Please use [$ColumnName] to replace your column name. And you can replace the prompt. Click Save when you are done.

    {
     "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
    "elmType": "div",
    "attributes": {
    "class": "=if([$priorcolumn] == '', '',if([$Comments]=='','sp-field-severity--severeWarning ms-fontColor-neutralSecondary',''))"
     },
    "children": [
     {
    "elmType": "span",
    "style": {
    "display": "inline-block",
    "padding": "0 4px"
     },
    "attributes": {
    "iconName": "=if([$priorcolumn] == '', '',if([$Comments]=='','Warning',''))"
     }
     },
     {
    "elmType": "span",
    "txtContent": "=if([$priorcolumn] == '', '',if([$Comments]=='','Required Info',@currentField))"
     }
     ]
    }
    

    enter image description here

    3.Here is my test result.

    User's image


    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.