Skip to content

items.GetSiteByName

Overview

This is the "GetSiteByName method" of the "Items Object". It gets site information based on the specified site name.

Prerequisites

  1. This function searches for the "site name" of a site. Please set the site name in advance. Please note that it is not the "Title" of the site.
    Where the "Site name" of a site is set

Syntax

items.GetSiteByName(name)

Parameters

Parameter Type Required Description
name object Yes Specify the site name

Return Value

Return an array of "apiModel" for the corresponding site.

Usage Examples

The following example gets site information for the site named "DepartmentMaster."

const sites = Array.from(items.GetSiteByName('DepartmentMaster'));
if (sites.length) {
    sites.forEach(site => {
        context.Log(site.SiteId);
        context.Log(site.Title);
        context.Log(site.ReferenceType);
    });
}