Skip to content

siteSettings

Overview

This object is used to read and change "Site Settings" in "Server Script".

Limitations

  1. Only the "When Reading Site Settings" condition can be used.

Properties

No Property name Change Description
1 DefaultViewId ○ "Default View" ID
2 Sections ○ Array of Section objects

Methods

No Name Description
1 SiteId Get the Site ID using the title of the "Site" as the key

Usage Example 1

In the following example, the view with ID 1 is set as the default view.

JavaScript
siteSettings.DefaultViewId = 1;

Usage Example 2

The following example gets section information and logs the section ID and label text.

JavaScript
let sections = siteSettings.Sections;
for (let section of sections) {
    context.Log(`${section.Id} ${section.LabelText}`);
}

Usage Example 3

In the following example, the site ID of the site whose name is Department Master is retrieved and output to the log.

JavaScript
let siteId = siteSettings.SiteId('Department Master');
context.Log(siteId);