Skip to content

items.MinDate

Overview

This is the "MinDate Method" of the "items Object". It gets the date value of the target date 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 "Date Column".

Syntax

items.MinDate(siteId, columnName, view)

Parameters

Parameter Type Required Description
siteId object Yes Specify the site ID of the target table
columnName string Yes Specify the date column to be calculated
view string No Specify the conditions for the records to be selected

Return Value

Return the minimum value of the specified date column in the target table.

If the specified date value column is not found utilities.EmptyTime is returned.

Usage Example 1

The following example gets the minimum value of DateA in the table with site ID 2.

JavaScript
let minDate = items.MinDate(2, 'DateA');

Usage Example 2

The following example gets the minimum value of DateA for the record whose Status is 900 (completed) in the table with site ID 2.

JavaScript
let view = {
    "View": {
        "ColumnFilterHash": {
            "Status": "[\"900\"]"
        }
    }
};
let minDate = items.MinDate(2, 'DateA', JSON.stringify(view));
context.Log(minDate);