Skip to content

Commit 3cdf79d

Browse files
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]>
1 parent 79cce53 commit 3cdf79d

File tree

1 file changed

+69
-11
lines changed

1 file changed

+69
-11
lines changed

docs/declarative-customization/list-form-configuration.md

+69-11
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ ms.localizationpriority: high
77

88
# Configure the list form
99

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.
1111

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.
1313

1414
## Get started
1515

@@ -18,23 +18,24 @@ To configure the form in a list or library:
1818
1. Go to the list or library for which you want to configure the form.
1919
1. If you are in a list:
2020

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.
2222

2323
1. If you are in a document library:
2424

25-
- Select a file.
26-
- Select ...
27-
- Select More
28-
- Select Properties
25+
- Select a file.
26+
- Select ...
27+
- Select More
28+
- Select Properties
2929

3030
1. At the top of the form, expand **Edit Form** icon and then select **Configure layout**
3131

3232
![Configure list form](images/list-form-configuration-menu.png)
3333

3434
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
3839

3940
## Configure custom header
4041

@@ -173,7 +174,7 @@ To configure the form in a list or library:
173174
- One or more sections can be defined for a body.
174175
- Each section can reference one or more columns in the list or library.
175176
- 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.
177178
- A column not referenced in any of the sections will be automatically referenced in the last section.
178179
- New columns added will be automatically referenced in the last section.
179180

@@ -242,3 +243,60 @@ To configure the form in a list or library:
242243
1. To preview your changes, click the **Preview** button.
243244
1. To save your changes, click the **Save** button.
244245
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.
301+
302+
![image](https://github.com/user-attachments/assets/74c21844-a966-4930-93bb-cce10d69fa0e)

0 commit comments

Comments
 (0)