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
Copy file name to clipboardExpand all lines: docs/declarative-customization/site-design-json-schema.md
+35-31Lines changed: 35 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -14,13 +14,13 @@ The overall JSON structure is specified as follows:
14
14
```json
15
15
{
16
16
"$schema": "schema.json",
17
-
"actions": [
18
-
...
19
-
<one or more verb actions>
20
-
...
21
-
],
22
-
"bindata": { },
23
-
"version": 1
17
+
"actions": [
18
+
...
19
+
<one or more verb actions>
20
+
...
21
+
],
22
+
"bindata": { },
23
+
"version": 1
24
24
};
25
25
```
26
26
@@ -34,7 +34,7 @@ You can view - and reference - the latest schema here: https://developer.microso
34
34
Use the **createSPList** verb to create a new SharePoint list.
35
35
36
36
> [!NOTE]
37
-
> Once **createSPList** is applied on a site, runnning the **createSPList** with the same list name will act as an update to the existing list.
37
+
> Once **createSPList** is applied on a site, runnning the **createSPList** with the same list name will act as an update to the existing list.
38
38
39
39
#### JSON values
40
40
@@ -90,23 +90,6 @@ Use the **createSPList** verb to create a new SharePoint list.
90
90
91
91
The subactions array provides additional actions to specify how to construct the list. Subactions are also specified using a **verb** value.
92
92
93
-
### setTitle
94
-
95
-
Sets a title which identifies the list in views.
96
-
97
-
#### JSON value
98
-
99
-
-**title**– The title of the new list.
100
-
101
-
#### Example
102
-
103
-
```json
104
-
{
105
-
"verb": "setTitle",
106
-
"title": "Customers and Orders"
107
-
}
108
-
```
109
-
110
93
### setDescription
111
94
112
95
Sets the description of the list.
@@ -132,6 +115,7 @@ Adds a new field.
132
115
133
116
-**fieldType**– The field type can be set to **Text**, **Note**, **Number**, **Boolean**, **User**, or **DateTime**. For other data types, see the addSPFieldXml action.
134
117
-**displayName**– The display name of the field.
118
+
-**id**– An optional attribute. If provided, specifies the id of the field. It needs to be a unique, randomly generated GUID. Providing a value for this is strongly recommended to ensure the field is not added multiple times if the script is re-run.
135
119
-**internalName**– An optional attribute. If provided, specifies the internal name of the field. If not provided, the internal name is based on the display name.
136
120
-**isRequired**–**True** if this field is required to contain information; otherwise, **false**.
137
121
-**addToDefaultView**–**True** if the field will be added to the default view; otherwise, **false**.
@@ -145,6 +129,7 @@ Adds a new field.
145
129
"fieldType": "Text",
146
130
"displayName": "Customer Name",
147
131
"isRequired": false,
132
+
"id": "c532fcb9-cdb3-45c6-8247-c784dcd58e1a"
148
133
"addToDefaultView": true
149
134
}
150
135
```
@@ -168,7 +153,7 @@ Deletes a default field that was provided by the selected template type.
168
153
169
154
### addSPFieldXml
170
155
171
-
Enables defining fields and their elements using Collaborative Application Markup Language (CAML). For reference, see [Field element (Field)](https://docs.microsoft.com/en-us/sharepoint/dev/schema/field-element-field).
156
+
Enables defining fields and their elements using Collaborative Application Markup Language (CAML). For reference, see [Field element (Field)](https://docs.microsoft.com/en-us/sharepoint/dev/schema/field-element-field). Note that providing the ID attribute in the field schemaXml is very important in order to prevent the field from being created multiple times if the script is run more than once.
172
157
173
158
Currently these field constructs cannot be designated as site columns nor added to content types. To create site columns with Field XML use the **createSiteColumnXml** action.
174
159
@@ -182,13 +167,13 @@ Currently these field constructs cannot be designated as site columns nor added
Enables defining lookup fields and their dependent lists element using Collaborative Application Markup Language (CAML). For reference, see [Field element (Field)](https://docs.microsoft.com/en-us/sharepoint/dev/schema/field-element-field).
176
+
Enables defining lookup fields and their dependent lists element using Collaborative Application Markup Language (CAML). For reference, see [Field element (Field)](https://docs.microsoft.com/en-us/sharepoint/dev/schema/field-element-field). Note that providing the ID attribute in the field schemaXml is very important in order to prevent the field from being created multiple times if the script is run more than once.
192
177
193
178
#### JSON value
194
179
@@ -475,6 +460,23 @@ Associates a ListViewCommandSet to the list
475
460
}
476
461
```
477
462
463
+
### setTitle
464
+
465
+
Sets a title which identifies the list in views.
466
+
467
+
#### JSON value
468
+
469
+
-**title**– The title of the new list.
470
+
471
+
#### Example
472
+
473
+
```json
474
+
{
475
+
"verb": "setTitle",
476
+
"title": "Customers and Orders"
477
+
}
478
+
```
479
+
478
480
## Define a new site column
479
481
480
482
Use the **createSiteColumn** verb to define a new site column that can then be associated to a list directly or by using the addContentType action.
@@ -485,6 +487,7 @@ Use the **createSiteColumn** verb to define a new site column that can then be a
485
487
-**internalName**– The internal name of the site column.
486
488
-**displayName**– The display name of the site column.
487
489
-**isRequired**–**True** if this field is required to contain information; otherwise, **false**.
490
+
-**id**– An optional attribute. If provided, specifies the id of the field. It needs to be a unique, randomly generated GUID. Providing a value for this is strongly recommended to ensure the field is not added multiple times if the script is re-run.
488
491
-**group**– An optional attribute to designate the column group.
489
492
-**enforceUnique**– An optional attribute that defaults to **false**. If **true**, all values for this field must be unique.
490
493
@@ -496,11 +499,12 @@ Use the **createSiteColumn** verb to define a new site column that can then be a
496
499
"fieldType": "User",
497
500
"internalName": "siteColumn4User",
498
501
"displayName": "Project Owner",
499
-
"isRequired": false
502
+
"isRequired": false,
503
+
"id": "181c4370-cdae-471b-9499-730046e55b75"
500
504
}
501
505
```
502
506
503
-
Use the **createSiteColumnXml** verb to define a new site column for those complex data types not supported by createSiteColumn. These columns can then be associated to a list directly or by using the addContentType action.
507
+
Use the **createSiteColumnXml** verb to define a new site column for those complex data types not supported by createSiteColumn. These columns can then be associated to a list directly or by using the addContentType action. Note that providing the ID attribute in the field schemaXml is very important in order to prevent the field from being created multiple times if the script is run more than once.
504
508
505
509
#### JSON value
506
510
@@ -512,7 +516,7 @@ Use the **createSiteColumnXml** verb to define a new site column for those compl
0 commit comments