question

KummariRani-8976 avatar image
0 Votes"
KummariRani-8976 asked EmilyDu-MSFT commented

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

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?

office-sharepoint-server-customization
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

EmilyDu-MSFT avatar image
0 Votes"
EmilyDu-MSFT answered EmilyDu-MSFT commented

@KummariRani-8976

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.



1.png (15.9 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

That formatting option is to hide/show in the view. I'm asking on the New/Edit forms. How to do it on the forms?

0 Votes 0 ·

@KummariRani-8976

In the modern New or Edit form, there is no option to achieve this.

0 Votes 0 ·

@KummariRani-8976

I’m checking how the things are going on about this issue. Whether the answer helps you?

If there is any problem with this issue, feel free to let me know.

0 Votes 0 ·

@KummariRani-8976

I am looking forward to your feedback if there is any update.

Please remember to update this thread if you have any progress.

Thank you for your understanding.

0 Votes 0 ·
sadomovalex avatar image
0 Votes"
sadomovalex answered KummariRani-8976 commented

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.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I'm mainly asking about modern view.
Is there any JSON to use on the forms? (the above answer is related to formatting views)

0 Votes 0 ·