What are the options for customizing sharepoint 2019 (on-prem) list forms?

Kummari, Rani 66 Reputation points
2021-10-20T17:29:20.337+00:00

Hello,
I'm looking for ways to customize sharepoint list forms on our sharepoint 2019 environment. Its easy to create a list and use it for simple functions but looking for ways to customize the forms such as making some columns visible on the form to certain groups, show certain columns based on the value of another column etc.
How to achieve this?

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,214 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Emily Du-MSFT 41,771 Reputation points Microsoft Vendor
    2021-10-21T08:35:02.187+00:00

    @Kummari, Rani

    1.Per my knowledge, making some columns visible in the form to certain groups is not available.

    2.You could use JSON formatting to hide the value of one column according to the value of another column. For example, when the value of column B is equal to 1, then SharePoint will hide the value of column A.

    (1)Select the column -> Column settings -> Format this column.
    142327-1.png
    (2)Add following codes.

    {  
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",  
      "elmType": "div",  
      "txtContent": "@currentField",  
      "style": {  
      "display": "=if([$B]=='1','none','')"  
      }  
    }  
    

    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. sadomovalex 3,626 Reputation points
    2021-10-21T14:52:59.857+00:00

    do you use modern or classic views? For modern you may use JSON formatting like it was mentioned, for classic you may edit list forms (same way as publishing pages), add content editor web part to the top web part zone and add necessary javascript there within <script type="text/javascript"></script> tags. In this script you may implement logic for customizing list forms.
    In OTB Sharepoint it is not possible to set fields visibility based on group membership so it should be done via custom code.