KrewData Features / Commands / Output App / Auto Number
In This Topic
    Auto Number
    In This Topic
    For auto number of the File Output command, refer to File Output > Auto Number.

    Output App command allows you to assign automatic numbering in any field of records and table records that are generated. Automatic numbering can be set in the Auto Number tab.

    Records Subject to Auto Number

    Automatic numbering is applied to new records that are added to the output app as a result of running the data editing flow. You cannot number records that already exist in the output app. The records subject to automatic numbering in each output method are as follows:

     Settings
    Setting Description
    1. Select field to output number Select field of the output app that is to be automatically numbered.
    2. Select numbering unit Select the numbering unit.
    • By App:Unique numbering is applied within the app selected in the output app command.
    • By Domain:Assigns unique numbers in the domain. In Select number of assign, specify the number already registered on Number setting in the domain page. This number can also be used in Output App commands placed in other data editing flows.
    3.Select fields identifies numbering group When By App is selected as numbering unit, select the field to group the records to be numbered.
    • None:Records are not grouped and serial numbers are assigned to all the generated records.
    • Select any field:Groups the records with same value in the selected field and numbers the records within the group.
    4.Select numbering cycle Sets the cycle to restart the numbering.
    When By Domain is selected as numbering unit, the numbering cycle is set on Number setting in the domain page. Also, numbering cycle can not be selected when a field is selected in Select fields identifies numbering group.  
    • None:Does not reset the numbering.
    • Daily:As the date changes, numbering restarts from 1.
    • Monthly:As the month changes, numbering restarts from 1.
    • Yearly:As the year changes, numbering restarts from 1.
    • Fiscal Yearly:As the fiscal year changes, numbering restarts from 1.
    The clock to determine the timing of the reset uses the time set in time zone settings done by the kintone user who runs the data editing flow.                   
    5.Set number of digits Set number of digits (1 or more) for numbering.
    • When field to get numbering is a text field and the number has digits less than the specified number, it is filled with zeroes and if the number of digits is more, it is automatically extended.
        Example) When number of digits is set to 2: 01, 02, 03 to 98, 99, 100, 101 etc.
    • When field to get numbering is itself a number field,
      this setting is ignored and numbered numeric value is outputted.
    6.Set text to add before the number Set text to append before number. This setting is ignored if field to be numbered is a number field.
    • None:No text is added.
    • Text:Adds a string.
    • Formula:Adds result of a formula.
    7.Set text to add after the number Set text to append after number. This setting is ignored if field to be numbered is a number field.
    • None:No text is added.
    • Text:Adds a string.
    • Formula:Adds result of a formula.
     Settings (Table)

    To automatically number the table records in output app, settings should be done for each table.

    Setting Description
    1. Select field to output number Select field of the table that is to be automatically numbered.
    2. Set number of digits Set number of digits (1 or more) for numbering.
    • When field to get numbering is a text field and the number has digits less than the specified number, it is filled with zeroes and if the number of digits is more, it is automatically extended.
        Example) When number of digits is set to 2: 01, 02, 03 to 98, 99, 100, 101 etc.
    • When field to get numbering itself is a number field
      this setting is ignored and numbered numeric value is outputted.
    3. Set text to add before the number Set text to append before number. This setting is ignored if field to be numbered is a number field.
    • None:No text is added.
    • Text:Adds a string.
    • Formula:Adds result of a formula.
    4. Set text to add after the number Set text to append after number. This setting is ignored if field to be numbered is a number field.
    • None:No text is added.
    • Text:Adds a string.
    • Formula:Adds result of a formula.
     Automatic Numbering by Domain

    If By Domain is selected as numbering unit, you can assign common numbers to multiple apps in the domain. Numbers used in domain-wise numbering must be registered in Number setting in the domain page of File tab before setting the automatic numbering.

    Settings

    Setting Description
    Number Name Enter any number name.
    Start Number Set the number (1 or above) to start the numbering from.
    Reset cycle Set the reset cycle to restart the numbering.
    • None:Does not reset the numbering.
    • Daily:As the date changes, numbering restarts from 1.
    • Monthly:As the month changes, numbering restarts from 1.
    • Yearly:As the year changes, numbering restarts from 1.
    • Fiscal Yearly:As the fiscal year changes, numbering restarts from 1.

    The clock to determine the timing of the reset uses the time set in time zone settings done by the kintone user who runs the data editing flow.

    Start Month If Fiscal Yearly is selected as reset cycle, select a month (January to December) to start the fiscal year.

     

     Example of Automatic Numbering

    1. Number all the output records in order

    In this example, we are numbering Bill Number field of each record that is generated.  

    Input Data

    Auto Number Settings

    1. Select field to output number
    Bill Number
    2. Select numbering unit 3. Select fields identifies numbering group 4. Select numbering cycle
    By App None None
    5. Set number of digits 6. Set text to add before the number 7. Set text to add after the number
    4 Formula
    ="Bill-"&TEXT(NOW(),"YYYY-")
    None

    Settings Page

    Execution Result

    2. Number the Table Records

    In this example, we are numbering Bill Number field of parent record and Item Number field of table. 

    Input Data

    Auto Number Settings

    Parent Record

    1. Select field to output number
    Bill Number
    2. Select numbering unit 3. Select fields identifies numbering group 4. Select numbering cycle
    By App None None
    5. Set number of digits 6. Set text to add before the number 7. Set text to add after the number
    4 Formula
    ="Bill-"&TEXT(NOW(),"YYYY-")
    None

    Table

    1. Select field to output number
    Item Number
    2. Set number of digits 3. Set text to add before the number 4. Set text to add after the number
    3 Text
    #
    None

    Settings Page

    Execution Result

    3. Group-wise Numbering

    In this example, we are grouping the records that have same values in Date and Company ID fields, and then number the records in each group.  

    Input Data

    Auto Number Settings

    1. Select field to output number
    Bill Number
    2. Select numbering unit 3. Select fields identifies numbering group 4. Select numbering cycle
    By App Date
    Company ID
    None
    5. Set number of digits 6. Set text to add before the number 7. Set text to add after the number
    2 Formula
    =Date&"-"&Company ID&"-"
    None

    Settings Page

    Execution Result

     Set Numbering Sequence

    Automatic numbering is applied in the order in which records are generated. To number the records in any other order, you can sort the output records by setting the Record Output Order of the Output App command.

    Below is an example of setting output order to parent records and table records.

    • Record Output Order setting of parent record: Product - Ascending order
    • Record Output Order setting of table record: Amount- Ascending order

     Limitations
    When automatic numbering is performed with following settings, numbering cannot be applied if there are already more than 2,00,000 records in the app that outputs the numbered records.
    • Output method: Update or Append
    • Numbering unit:By App

    If there are more than 2,00,000 records in the output app, an error occurs while executing the data editing flow.

    See Also