User Manual

10.04.2024

MANUAL

Developer Function: Server Script: items.Max

## Overview This is the "Max Method" of the "[Items Object](/en/manual/server-script-items)". It gets the maximum value of the target numerical value column in the specified table. You can specify selection conditions to narrow down the records to be aggregated. ## Limitations 1. Cannot be used for anything other than "「Numerical Value Column」". ## Syntax ``` items.Max(siteId, columnName, view) ``` ## Parameters |Parameter|Type|Required|Description| |:----------|:----------|:---:|:---------------------------| |siteId|object|Yes|Specify the site ID of the target table| |columnName|string|Yes|Specify the numerical value column to be calculated| |view|string|No|Specify the conditions for the records to be selected| ## Return Value Return the maximum value of the specified numerical value column in the target table. ## Usage Example 1 The following example gets the maximum value of NumA (NumA) in the record registered in the table with site ID of 2. ##### JavaScript ``` let max = items.Max(2, 'NumA'); ``` ## Usage Example 2 The following example gets the maximum value of NumA (NumA) in the record whose Status is 200 (running) in the table with site ID 2. ##### JavaScript ``` let view = { "View": { "ColumnFilterHash": { "Status": "[\"200\"]" } } }; let max = items.Max(2, 'NumA', JSON.stringify(view)); context.Log(max); ``` ## Related Information <div id="ManualList"><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.