Skip to content

Commit a45f4dc

Browse files
authored
Update site-design-json-schema.md
Updated for Spring 2018 release. Changes include: attribute updates for addSPField; addSPFieldXml; createSiteColumn; addSiteColumn; createContentType; addSPView; removeSPView; installSPFXSolution; setRegionalSettings
1 parent cae2020 commit a45f4dc

File tree

1 file changed

+242
-4
lines changed

1 file changed

+242
-4
lines changed

docs/declarative-customization/site-design-json-schema.md

Lines changed: 242 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,12 @@ Adds a new field.
9191

9292
JSON values:
9393

94-
- **fieldType** - The field type can be set to **Text**, **Note**, **Number**, **Boolean**, **User**, or **DateTime**.
94+
- **fieldType** - The field type can be set to **Text**, **Note**, **Number**, **Boolean**, **User**, or **DateTime**. For other data types see the addSPFieldXml action.
9595
- **displayName** - The display name of the field.
96+
- **internalName** - An optional attribute. If provided, specifies the internal name of the field. If not provided, the internal name will be based on the display name.
9697
- **isRequired** - True if this field is required to contain information; otherwise, false.
9798
- **addToDefaultView** - True if the field will be added to the default view; otherwise, false.
99+
- **enforceUnique** - An optional attribute that defaults to false. If true, then all values for this field must be unique.
98100

99101
Example:
100102

@@ -125,9 +127,193 @@ Example:
125127
}
126128
```
127129

130+
### addSPFieldXml
131+
132+
Enables defining fields and their elements using Collaborative Application Markup Language (CAML). For reference see: https://msdn.microsoft.com/en-us/library/office/aa979575.aspx
133+
134+
Currently these field constructs cannot be designated as site columns nor added to content types.
135+
136+
JSON value:
137+
138+
- **schemaXml** - The CAML block to define the field.
139+
- **addToDefaultView** - True if the field will be added to the default view; otherwise, false.
140+
141+
Example:
142+
143+
```json
144+
{
145+
"verb": "addSPFieldXml",
146+
"schemaXml": "<Field Type=\"Choice\" DisplayName=\"Project Category\" Required=\"FALSE\" Format=\"Dropdown\" StaticName=\"ProjectCategory\" Name=\"ProjectCategory\"><Default>Operations</Default><CHOICES><CHOICE>Operations</CHOICE><CHOICE>IT</CHOICE><CHOICE>Legal</CHOICE><CHOICE>Engineering</CHOICE></CHOICES></Field>"
147+
}
148+
```
149+
150+
### addSPView
151+
152+
Defines and adds a view to the list. Use this action to specify the desired columns and how you want the list items displayed (using a CAML query). Subactions allow you to specify row limits, whether the view is paged, and recurses over items in nested folders or not. You can also designate your constructed view as the default.
153+
154+
JSON value:
155+
156+
- **name** - The name of the view.
157+
- **viewFields** - an array of the internal names of the fields in your view.
158+
- **query** - A CAML query string that contains the where clause for the view's query. See https://msdn.microsoft.com/en-us/library/ms462365
159+
- **rowLimit** - The row limit of the view.
160+
- **isPaged** - Specifies whether the view is paged.
161+
- **makeDefault** - If true, the view will be made the default for the list; otherwise, false.
162+
- **scope** - An optional setting to specify the scope of the view. For more details see See https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spviewscope.aspx
163+
164+
Example:
165+
166+
```json
167+
{
168+
"verb": "addSPView",
169+
"name": "Contoso Projects by Category",
170+
"viewFields":
171+
[
172+
"ID",
173+
"Title",
174+
"siteColumnUser",
175+
"ProjectCategory"
176+
],
177+
"query": "<OrderBy><FieldRef Name=\"ProjectCategory\" /><FieldRef Name=\"siteColumnUser\" Ascending=\"FALSE\" /></OrderBy>",
178+
"rowLimit": 100,
179+
"isPaged": true,
180+
"makeDefault": true
181+
}
182+
```
183+
184+
### removeSPView
185+
186+
Removes a view from a list. This action can also be used to remove a view applied by the site template.
187+
188+
JSON value:
189+
190+
- **name** - The name of the view to remove.
191+
192+
Example:
193+
194+
```json
195+
{
196+
"verb": "removeSPView",
197+
"name": "All Items"
198+
}
199+
```
200+
201+
### createSiteColumn
202+
203+
Defines a new site column that can then be associated to a list directly or using the addContentType action.
204+
205+
JSON value:
206+
207+
> [!NOTE]
208+
> When referencing the content type ID only one of the three references are required - ID, parentName, or parentId
209+
210+
- **fieldType** - The type of column to add. Supported values - like SPField - are Text, Note, Number, Boolean, User, and DateTime. For other data types refer to the addSPFieldXml script action.
211+
- **internalName** - The internal name of the site column.
212+
- **displayName** - The display name of the site column.
213+
- **isRequired** - True if this field is required to contain information; otherwise, false.
214+
- **group** - An optional attribute to designate the column group.
215+
- **enforceUnique** - An optional attribute that defaults to false. If true, then all values for this field must be unique.
216+
217+
Example:
218+
219+
```json
220+
{
221+
"verb": "createSiteColumn",
222+
"fieldType": "User",
223+
"internalName": "siteColumn4User",
224+
"displayName": "Project Owner",
225+
"isRequired": false
226+
}
227+
```
228+
229+
### addSiteColumn
230+
231+
Subaction to add a previously defined site column directly to a list or content type (exisiting or created through the site script).
232+
233+
> [!NOTE]
234+
> This action can be used to add created site columns to a list or content type.
235+
236+
JSON value:
237+
238+
- **internalName** - The internal name of the site column to add.
239+
240+
Example:
241+
242+
```json
243+
{
244+
"verb": "addSiteColumn",
245+
"internalName": "siteColumnUser"
246+
}
247+
```
248+
249+
### removeSiteColumn
250+
251+
Subaction to remove a site column from a list or content type.
252+
253+
JSON value:
254+
255+
- **internalName** - The internal name of the site column to remove.
256+
257+
Example:
258+
259+
```json
260+
{
261+
"verb": "removeSiteColumn",
262+
"internalName": "siteColumnUser"
263+
}
264+
```
265+
266+
### createContentType
267+
268+
Defines a new content type that can then be associated to a list using the addContentType action.
269+
270+
JSON value:
271+
272+
> [!NOTE]
273+
> When referencing the content type ID only one of the three references are required - ID, parentName, or parentId
274+
275+
- **name** - The name of the content type to create.
276+
- **description** - The optional description of the content type.
277+
- **parentName** - Name of the parent content type.
278+
- **parentId** - ID of the parent content type.
279+
- **id** - ID of the content type.
280+
- **hidden** - Specifies whether the content type is visible or hidden.
281+
- **subactions** - Specifies subactions to run on the content type. These are used to designate the site columns to add.
282+
283+
Example:
284+
285+
```json
286+
{
287+
"verb": "createContentType",
288+
"name": "Contoso Projects",
289+
"description": "custom list content type",
290+
"parentName": "Item",
291+
"hidden": false,
292+
"subactions":
293+
[
294+
{
295+
"verb": "addSiteColumn",
296+
"internalName": "siteColumn1Text"
297+
},
298+
{
299+
"verb": "addSiteColumn",
300+
"internalName": "siteColumn2Number"
301+
},
302+
{
303+
"verb": "addSiteColumn",
304+
"internalName": "siteColumn3Note"
305+
}
306+
]
307+
}
308+
```
309+
128310
### addContentType
129311

130-
Adds a content type to the list. Currently these are limited to only the default content types included in the site template.
312+
Adds a content type to the list. Currently these are limited to the default content types included in the site template or ones defined in a script using the createContentType action.
313+
314+
315+
> [!NOTE]
316+
> Currently we do not support adding enterprise content types.
131317
132318
JSON value:
133319

@@ -274,6 +460,9 @@ Example:
274460
275461
Use the **createPage** verb to create a new page on the site.
276462
463+
> [!NOTE]
464+
> The createPage site script action is in preview and is subject to change. It is not currently supported for use in production environments.
465+
277466
JSON values:
278467
279468
- **fileName** - The name of the file.
@@ -304,7 +493,10 @@ Example:
304493

305494
## Set a site logo
306495

307-
Use the **setSiteLogo** verb to specify a logo for your site. This action only works on the communication site template (68).
496+
Use the **setSiteLogo** verb to specify a logo for your site.
497+
498+
> [!NOTE]
499+
> This action only works on the communication site template (68).
308500
309501
JSON value:
310502

@@ -326,13 +518,14 @@ Use the **joinHubSite** verb to join the site to a designated hub site.
326518
JSON value:
327519

328520
- **hubSiteId** - The ID of the hub site to join.
521+
- **name** - An optional string specifying the name of the hub site.
329522

330523
Example:
331524

332525
<!-- TBD: add link to Dave's hub site documentation -->
333526

334527
> [!NOTE]
335-
> Hub sites are a new feature that are just rolling out to customers in Targeted Release in March 2018.
528+
> Hub sites are a new feature that are just rolling out to customers in Targeted Release in March 2018. This action might not be available for use in your environment. To learn more check out https://docs.microsoft.com/en-us/sharepoint/dev/features/hub-site/hub-site-overview
336529
337530
```json
338531
{
@@ -341,6 +534,27 @@ Example:
341534
}
342535
```
343536

537+
## installSPFXSolution
538+
539+
Use the **installSPFXSolution** action to register a deployed solution from the app catalog.
540+
541+
JSON values:
542+
543+
- **id** - The id of the catalog solution.
544+
545+
Example:
546+
547+
> [!NOTE]
548+
> To get the solution ID login to a site using Connect-PnPOnline cmdlet and then run Get-PnPApp. This will return a list of your deployed solutions.
549+
550+
```json
551+
{
552+
"verb": "installSPFXSolution",
553+
"id": "d40e4edc-a6da-4cd8-b82d-bba970976803"
554+
}
555+
```
556+
557+
344558
## Trigger a flow
345559

346560
Use the **triggerFlow** verb to kick off a custom flow.
@@ -365,6 +579,30 @@ Example:
365579
}
366580
}
367581
```
582+
583+
## setRegionalSettings
584+
585+
Use the **setRegionalSettings** action to configure the regional settings of the site (/_layouts/15/regionalsetng.aspx).
586+
587+
JSON values:
588+
589+
- **timeZone** - A number specifying the time zone. For list of permissible values see https://msdn.microsoft.com/library/microsoft.sharepoint.spregionalsettings.timezones.aspx
590+
- **locale** - A number specifying the culture LCID. For list of permissible values see https://msdn.microsoft.com/en-us/library/ms912047(v=winembedded.10).aspx
591+
- **sortOrder** - A number specifying the sort order. For list of permissible values see https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spregionalsettings.collation.aspx
592+
- **hourFormat** - Specifies whether the site should use 12-hour or 24-hour time format.
593+
594+
Example:
595+
596+
```json
597+
{
598+
"verb": "setRegionalSettings",
599+
"timeZone": 2, /* Greenwich Mean Time */
600+
"locale": 1050, /* Croatia */
601+
"sortOrder": 6, /* Croatian */
602+
"hourFormat": "24"
603+
}
604+
```
605+
368606
## setSiteExternalSharingCapability
369607

370608
Use the **setSiteExternalSharingCapability** to manage guest access. For details on these settings refer to: https://support.office.com/en-us/article/Manage-external-sharing-for-your-SharePoint-Online-environment-C8A462EB-0723-4B0B-8D0A-70FEAFE4BE85

0 commit comments

Comments
 (0)