Job Runner

Calculate Age

Overview

Calculate an age based on a Date field and pass the calculation result to the specified field.

Usage

To pass the calculated age value to a field, add that field to the Kintone app and then select that field in the Age Field parameter.

To modify the formatting so that the calculated age is not simply displayed as a number (e.g. when you want to display the age in full years), follow the steps below.

  1. Leave the Age Field parameter empty.
  2. Add a new Action that runs the Do Set Field Value, and input the formula below into the Value parameter.
= "Full" & $1 & "old"
  • The digit in the “$1” string must match the Action Number of the Action that runs “Calculate Age.” For example, if the Action Number is 3, change the string to $3.

Parameters

Set Date, Birthday, and Age Field.

Record

Select the Action you used to retrieve the target records.

If multiple records are included, it is processed for each record. If there are no records, nothing is done.

If more than one record is included, only the Action results for the last row remain.

Birthday

Select a Date or Date and time field containing the birthday for the calculation.

You cannot include fields that are within a table.

If you select a Date and time field, the Do will exclude the time data from the calculation.

Base Date

Specify when the age is calculated.

Optional, if omitted, it calculates the age at the date the action was performed. Your act date is based on the Set Time Zone setti

If you want to take the reference date from a field value, use an expression. The following example uses the field value with the field code “Date_2”.

=Date_2

You can also specify the results of the action of Calculate Date. For example, if you want the result of “Get Specific Date” to be the reference date, if the action is #1, you can specify it as follows:

= $1

Age Field

Use this parameter to select the field that should receive the calculated value. This parameter is optional.

This parameter accepts the following field types:

  • Text
  • Number
  • Text area
  • Rich text

You cannot include fields that are within a table.

If you leave this parameter empty, the calculated age will not appear. However, other Actions will still be able to access the calculated age value.

関連記事