You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added a new feature in Custom formatter for making fields readonly (#10168)
* Added a new feature in Custom formatter for making fields readonly in the client form.
* Update list-form-configuration.md
* Fix grammar & markdown issues
- fixed incorrect grammar
- mardown issues
- fixed incorrect indentation
- always have newlines between paragraphs, headings & bullet lists
- don't add newlines between bullets in bullet lists
- remove unnecessary extra blank lines at end of doc
---------
Co-authored-by: Andrew Connell <[email protected]>
Copy file name to clipboardExpand all lines: docs/declarative-customization/list-form-configuration.md
+69-11
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,9 @@ ms.localizationpriority: high
7
7
8
8
# Configure the list form
9
9
10
-
You can configure the list form in a list or library with a custom header, footer and the form body with one or more sections with fields in each of those sections. The form configuration does not change the data in the list item or file; it only changes how the form is displayed to users who browse the list or library. Anyone who can create and manage views in a list can use form configuration to configure the form with header, footer and body with sections.
10
+
You can configure the list form in a list or library with a custom header, footer and the form body with one or more sections with fields in each of those sections. The form configuration does not change the data in the list item or file; it only changes how the form is displayed to users who browse the list or library. Anyone who can create and manage views in a list can use form configuration to configure the form with header, footer, and body with sections.
11
11
12
-
To configure a form, you will use JSON formatters that you are already familiar with when formatting a [column](column-formatting.md) or a [view](view-formatting.md) in a list or library. Form configuration allows for certain predefined elements and attributes to build the custom header, footer and body with one or more sections.
12
+
To configure a form, you will use JSON formatters that you are already familiar with when formatting a [column](column-formatting.md) or a [view](view-formatting.md) in a list or library. Form configuration allows for certain predefined elements and attributes to build the custom header, footer, and body with one or more sections.
13
13
14
14
## Get started
15
15
@@ -18,23 +18,24 @@ To configure the form in a list or library:
18
18
1. Go to the list or library for which you want to configure the form.
19
19
1. If you are in a list:
20
20
21
-
- Open an item to view the item details in the display form.
21
+
- Open an item to view the item details in the display form.
22
22
23
23
1. If you are in a document library:
24
24
25
-
- Select a file.
26
-
- Select ...
27
-
- Select More
28
-
- Select Properties
25
+
- Select a file.
26
+
- Select ...
27
+
- Select More
28
+
- Select Properties
29
29
30
30
1. At the top of the form, expand **Edit Form** icon and then select **Configure layout**
31
31
32
32

33
33
34
34
1. In the **Format** pane, you can choose to apply formatting to the following form sections:
35
-
- Header
36
-
- Body
37
-
- Footer
35
+
36
+
- Header
37
+
- Body
38
+
- Footer
38
39
39
40
## Configure custom header
40
41
@@ -173,7 +174,7 @@ To configure the form in a list or library:
173
174
- One or more sections can be defined for a body.
174
175
- Each section can reference one or more columns in the list or library.
175
176
- A column can be referenced only in one section.
176
-
- If a column is referenced in multiple sections, the first section where the column is referenced will take the precedence.
177
+
- If a column is referenced in multiple sections, the first section where the column is referenced will take precedence.
177
178
- A column not referenced in any of the sections will be automatically referenced in the last section.
178
179
- New columns added will be automatically referenced in the last section.
179
180
@@ -242,3 +243,60 @@ To configure the form in a list or library:
242
243
1. To preview your changes, click the **Preview** button.
243
244
1. To save your changes, click the **Save** button.
244
245
1. Close and open the form again to view the custom body.
246
+
247
+
248
+
## Custom Formatter for Read-Only Fields
249
+
250
+
### Introduction
251
+
252
+
Microsoft Lists offers a powerful way to organize information and collaborate with your team. With the rise of AI-based list item creation, users often need to view but not edit certain fields — like system-generated data or bot-added details. To meet this need, a new custom formatter feature is proposed to allow fields to appear as read-only in list forms.
253
+
254
+
### Why Read-Only Fields Matter
255
+
256
+
Currently, read-only fields are hidden from New Item and Edit forms. This creates challenges when AI bots or automated processes create items containing critical data that users need to see but not modify. For example:
257
+
258
+
- A bot creates a customer service ticket with Issue details Issue Title, Issue Description.
259
+
- Users should see this information to take actions (e.g., send an email), but not be able to change it.
260
+
261
+
The new custom formatter solves this by allowing these fields to display as read-only.
262
+
263
+
### How the Custom Formatter Works
264
+
265
+
The custom formatter introduces a new JSON configuration to mark fields as read-only in the form views.
266
+
267
+
### JSON Structure
268
+
269
+
```json
270
+
{
271
+
"sections": [{}],
272
+
"fieldsettings": [
273
+
{
274
+
"name": "fieldName",
275
+
"readonly": true
276
+
}
277
+
]
278
+
}
279
+
```
280
+
281
+
- name: The internal name of the field.
282
+
- readonly: When set to true, the field is displayed as read-only.
283
+
284
+
### Behavior in Different Form Views
285
+
286
+
The custom formatter ensures a consistent user experience:
287
+
288
+
- New Item form: The read-only field will not be shown.
289
+
- Edit form: The field is displayed without an editable textbox, similar to a Calculated Column.
290
+
- Edit all mode: The field remains visible and uneditable.
291
+
292
+
The Save button works as expected — no accidental modifications to the read-only fields.
293
+
294
+
### Example Use Case
295
+
296
+
Imagine a CRM bot creating tickets with pre-filled Issue details. Using this formatted:
297
+
298
+
- Issue Title (read-only): Users can see and copy the Issue Title but can't modify it.
299
+
- Issue Description (read-only): Users can see and copy the Issue Description but can't modify it.
300
+
- Issue Source (read-only): Users can click on the Issue source link but can't modify it.
0 commit comments