User Manual

10.04.2024

MANUAL

Developer Function: Server Script: items.Count

## Overview This is the "Count Method" of the "[Items Object](/en/manual/server-script-items)". It counts the number of records in the specified table. You can specify selection conditions to narrow down the records to be counted. ## Syntax ``` items.Count(siteId, view) ``` ## Parameters |Parameter|Type|Required|Description| |:----------|:----------|:---:|:---------------------------| |siteId|object|Yes|Specify the site ID of the target table| |view|string|No|Specify the conditions for the records to select| ## Return Value Return the number of records. ## Usage Example 1 The following example counts the number of records registered in the table with site ID 2. ##### JavaScript ``` let count = items.Count(2); ``` ## Usage Example 2 The following example counts the number of records registered in the table with site ID 2 and with a Status of 900 (completed). ##### JavaScript ``` let view = { "View": { "ColumnFilterHash": { "Status": "[\"900\"]" } } }; let count = items.Count(2, JSON.stringify(view)); context.Log(count); ``` ## Notes This is a method used in "[Server Script](/en/manual/table-management-server-script)". It cannot be used in "[Script](/en/manual/table-management-script)". ## Related Information <div id="ManualList"><ul><li><a href="/en/manual/table-management-script">Table Management: Script</a><span>08.13.2024 up</span></li> <li><a href="/en/manual/table-management-server-script">Table Management: Server Script</a><span>08.13.2024 up</span></li></ul></article> <ul><li><a href="/en/manual/server-script-items">Developer Function: Server Scripts: items</a><span>08.14.2024 up</span></li></ul></article></div><input id="SearchTextHidden" type="hidden" value="" />
TOP
このページをシェアする
記載された商品名、各製品名は各社の登録商標または商標です。 © Implem Inc.