Job Runner

Auto Numbering

Summary

Automatically generates numbering in a specific field.

Usage

When you execute an Action with this Do, Customine communicates with Gusuku’s server to generate numbers and then exports those values to the specified field.

The values taken as a result of the Action are set in array format. The number of elements in the array will be the same as the number of rows in the record contained in the Record parameter. Each value in the array is formatted after applying zero padding, prefix, or suffix Formatting.

If you perform this Do, the field value is changed from its original value, and records are reserved for saving. Updated records are not saved immediately but automatically after all actions in the job are finished. Use Save Modified Record to save the updated records at a different time.

You will need an API Token with the edit record permission for the app when autosaving. Make sure to Set Kintone API Token in another action and set the API Token for the Kintone app.

Parameters

Set Record, Field, and rules to configure the auto-numbering rules.

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.

Field

Select the field that should receive the generated number.

This parameter accepts the following field types:

  • Text
  • Number

You cannot include fields that are within a table.

Note that the generated numbers are formatted (e.g. padded with zeros) before they are exported to the target field.

You can omit this parameter if you want to use the generated numbers in a different Action without immediately retrieving them.

Numbering by App

If you choose “No”, the Action will generate a sequential numbering for the entire domain.

If you select “Numbering by App”, each app will be assigned separate sets of sequential numbers.

Zero Padding

If you enable zero padding, the Do will pad the value with zeros if it has fewer digits than the value specified in the parameter Number of Digits.

If you have enabled zero padding, the Number of Digits parameter value must be one or higher.

Example: If the Action generates the number 1, you have enabled zero padding and set the Number of Digits to 8, and the Action will export the value 00000001 to the field.

Number of Digits

Specifies the maximum number of zero-padded digits. This parameter is ignored if zero padding is disabled.

Note that this Do never discards digits, even if the generated number has more digits than the limit set in this parameter. For example, if you set the number of digits to 3 and the Do generates 1234, the Do does not change the number to 123 or 234. The generated value is exported to the field without modifications.

Prefix

Use this parameter if you want to attach a specific string to the start of every number.

Suffix

Use this parameter if you want to attach a specific string to the end of every number.

Numbering Cycle

If you choose “None”, the numbering will never be reset.

If you choose “Monthly, the sequential numbering is reset to 1 the following month.

If you choose “Yearly”, the sequential numbering is reset to 1 at the start of the year (January 1).

If you choose “Fiscal yearly (starting in April)”, the sequential numbering is reset to 1 on April 1.

Time Zone

If you selected a numbering cycle in the previous parameter, use the Time Zone parameter to choose which country/region’s timezone should be used to manage the numbering cycle.

Numbering Key

Use this parameter if you want to set your own numbering key. This parameter is optional.

Note that if you have multiple Actions (each running its own instance of Auto Numbering), and you leave the Numbering Key parameter empty, the Do will treat all fields identified by the field code specified in Field Code as belonging to the same numbering group and thus generate a sequential numbering local to this group. If you specify a Numbering Key, the Do will instead treat all fields identified by that key as belonging to the same numbering group and will generate a sequential numbering local to that group.

自動採番の範囲について

自動採番がどの範囲で連続性をもつのかどうかは「フィールド」「アプリ単位の採番」「採番キー」の組み合わせによって変わります。以下の表を参考にしてください。

フィールド アプリ単位の採番 採番キー 採番の範囲
指定なし なし 指定なし 同一アクション番号
指定なし なし 指定あり 同一採番キー
指定なし アプリ単位で採番 指定なし アプリ内の同一アクション番号
指定なし アプリ単位で採番 指定あり アプリ内の同一採番キー
指定あり なし 指定なし 同一フィールドコード
指定あり なし 指定あり 同一採番キー
指定あり アプリ単位で採番 指定なし アプリ内の同一フィールド
指定あり アプリ単位で採番 指定あり アプリ内の同一採番キー

特に、この3つのパラメーターを全て省略した場合、kintoneサブドメイン全体での広い範囲の連番になるのではなく、逆にそのアクションのみの狭い範囲の連番になる点に注意してください。アプリを横断してkintoneサブドメイン全体での連番を行いたい場合は「アプリ単位の採番」を「なし」にして「採番キー」を指定してください。

Restrictions

  • The maximum number of records that can be numbered once is 100,000. An error occurs if the number of records is more than 100,000.

  • If you specify a Number field in the Field parameter and have added a prefix or suffix, an error occurs when it runs.

関連記事