How to make Title column mandatory in Document library (Sharepoint 2019 on prem - Modern XP)

stephanie park 0 Reputation points
2023-11-24T08:45:04.04+00:00

We have a document library where the column title is set as mandatory, but still, we are able to upload document without inputting any data in this field. As you can see in the screen capture, other mandatory fields are highlighted in yellow when empty. We would like the same visual for the Title column.

In the info pane, it is stated as Mandatory thought.

Any idea how to proceed?

Image

Image

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,297 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,274 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Ling Zhou_MSFT 15,475 Reputation points Microsoft Vendor
    2023-11-27T02:28:16.5766667+00:00

    Hi @stephanie park,

    Thank you for posting in this community.

    In fact, in SharePoint document libraries we don't consider the Title column to be very important, it is the Name column that is important. You can prove this by the fact that the default view does not show the Title column. Therefore, SharePoint was not designed with the Title column as being a column that can be configured to force information to be included.

    I would therefore recommend that you create your own column that you want to force to contain information, such as Title1. And then hide the Title column from the view. (The Title column can also not be deleted.)

    1.Click on the upper gear icon >Library Settings>Columns>create column.

    1

    2

    2.Hide the Title Column.

    Click on the upper gear icon >Library Settings>Views>Select your view> uncheck the Title>OK.

    6

    7

    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.


  2. Ling Zhou_MSFT 15,475 Reputation points Microsoft Vendor
    2023-11-30T06:49:29.7633333+00:00

    Hi @stephanie park,

    I tested your question again and again. It is true that for columns of content type there is no yellow error message for unfilled mandatory fields.

    The answer to my last question was able to make a similar error message through conditional judgment. If you still want to know why the title column doesn't behave like the other columns which can highlight the filed in yellow automatically, I suggest you open a ticket for this.

    Thank you for your kind understanding.


    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 comments No comments

  3. Ling Zhou_MSFT 15,475 Reputation points Microsoft Vendor
    2023-11-28T09:43:09.26+00:00

    Hi @stephanie park,

    It occurred to me that we could add a conditional judgment on the Title column to display an error message when the value is null.

    1.Format This column.

    User's image

    2.Copy the following JSON.

    User's image

    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
      "elmType": "div",
      "attributes": {
        "class": {
          "operator": "?",
          "operands": [
            {
              "operator": "==",
              "operands": [
                "[$Title]",
                ""
              ]
            },
            "sp-field-severity--warning ms-fontColor-neutralSecondary",
            ""
          ]
        }
      },
      "children": [
        {
          "elmType": "span",
          "style": {
            "display": "inline-block",
            "padding": "0 4px"
          },
          "attributes": {
            "iconName": {
              "operator": "?",
              "operands": [
                {
                  "operator": "==",
                  "operands": [
                    "[$Title]",
                    ""
                  ]
                },
                "Error",
                ""
              ]
            }
          }
        },
        {
          "elmType": "span",
          "txtContent": {
            "operator": "?",
            "operands": [
              {
                "operator": "==",
                "operands": [
                  "[$Title]",
                  ""
                ]
              },
              "Request Info",
              "[$Title]"
            ]
          }
        }
      ]
    }
    

    My prompt message is "Request Info", you can change it to your own prompt message.

    User's image

    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.


  4. stephanie park 0 Reputation points
    2023-11-29T10:53:30.7+00:00

    Hi @Ling Zhou_MSFT ,

    It works only as long as the configuration panel open. Once I close it, it doesn't work anymore. Plus this is a work around. I don't understand why if I say that the title colum is mandatory, it doesn't behave like the other columns and highlight the filed in yellow automatically.

    0 comments No comments