Auto-number

Follow

The Auto-number widget can be used to automatically create integer numbers in an ascending order. These would be typically used as reference numbers (such as Invoice Numbers). Auto-numbers can be one of two types "When Collected" or "As Received".

For the "When Collected" type, doForms generates these numbers based on the current date:time in the format yyymmddhhmmssss. So, for example, an auto-number generated at 5:18:24.12 PM on March 27, 2014 would be 14032717182412. This algorithm allows you to produce a pattern of unique ascending numbers across multiple mobile devices that are operating in disconnected mode.  When displayed on the mobile device, an "When Collected" auto-number question might look similar to the following:

For the "As Received" type, doForms generates these numbers based on a first-come first-serve basis as incoming data records are received by the server.  This means that the auto-number sequence has nothing to do with the order that the data records were completed by different mobile users.  The "As Received" type can also have a "Start Value" that determines the start of the integer sequence.  Note that since "As Received" auto-numbers are assigned by the website as data records are received they are not visible in the mobile app.

IMPORTANT - If you are creating new records in the Dispatch tab, "As Received" auto-numbers are created at the time when the record is received by the website from the mobile device.  As such, the "As Received" auto-number will not be seen by the mobile user, but it will be seen on the website and emailed reports.

IMPORTANT - Once an "As Received" auto-number is set in a data record received by the website, it will not be changed as a result of any subsequent Retrieve or Forward transactions on the same data record.  However, a "When Collected" auto-number may be changed by subsequent Retrieve or Forward transactions.

Both types can have a "Prefix" which is appended to the beginning of the number value.  Note that in the "As Received" case, all forms in the account that have the same Prefix will share the same auto-number sequence.  The illustration below below shows three different forms (A, B, C) in the same account that use the same prefix "acme-" and a start value of 100.  Note carefully how the auto-numbers are assigned based on a first-come first-serve basis:

The above example would be very useful if say "Acme Corp." had 3 versions of an invoice form for special purposes, but wanted all the forms to share a single numbering sequence.

You can further control "As Received" auto-numbers using the "Reset numbering in all forms using this prefix" option.  Using this option resets the "As Received" auto-number sequence of ALL forms in the account using the same prefix to the "Start value". This reset happens when this form is published. Note that the reset only applies to new incoming data records from these forms and will not affect any previously submitted data records.

Adding the Auto-number widget is as simple as using a “drag and drop” motion to place it on the form canvas. 

The Auto-number question widget includes the following special properties that you can use to control the look and behavior of Auto-number:

Caption text - Refers to the question caption as presented to the user. Think of this as the title for the question; it should be self-descriptive. We recommend no more than three words for optimal display on mobile devices.

Hint - Additional help for the question will be displayed; short clear sentences work best. Use 80 characters or less for optimal display on mobile devices. The maximum number of characters is 500, including spaces. The following HTML formatting tags are currently recognized:

Android: <br>, <i>, <b>, <u>, <font color="xxx">, <H1>, <H2>, <H3>, <H4>, <H5>, <P>, <a>, <div>;
iOS: <br>;
PDF reports: <br>, <font color="xxx">.

Data name - Represents the name of the data that will be displayed in column headings. This property is automatically filled in based on the Caption Text, but may be modified in the properties area. We recommend one or two word data names to keep column headings short. The maximum number of characters is 30. Spaces are not permitted in the Data Name field. 

Type - There are two types (a) "When Collected" which creates an auto-number in the format yyymmddhhmmssss when the widget is executed in the mobile app, and (b) "As Received" which generates sequential integer auto-numbers in the form i, i+1, i+2 etc, as the data record is received by the website.  Please see the explanation at the top of this article.

Prefix - Alpha-numeric prefix that will be appended at the beginning of each auto-number.  Prefixes can be added to both "When Collected" and "As Received" types.  Note that in the "As Received" case, all forms in the account that have the same Prefix will share the same auto-number sequence.  So for example, if Form A and Form B both contain "As Received" auto-number widgets with the same prefix (say "XYZ"), then the incoming data from both forms will be assigned XYZ1, XYZ2, XYZ3 etc. on a first-come first-serve basis.  Note that all forms that use the "null prefix (i.e, "no prefix") also share the share the same auto-number sequence.

Start value - An integer value that starts the "As Received" auto-number sequence.  The default value is 1. So for example, if the start value is 1000, and the prefix is "abc-", then the incoming data records will receive auto-numbers abc-1000, abc-1001, abc-1002, etc.  This option applies to the "As Received" type only.

Reset numbering in all forms unsung this prefix - Selecting this option resets the "As Received" auto-number of ALL forms in the account using the same prefix to the "Start value". This reset happens when this form is published. Note that the reset only applies to new incoming data records and will not affect any previously submitted data records.  This option applies to the "As Received" type only.

Read only - Determines whether or not this field can be edited. This is used in combination with a Default Value.

Required - Determines whether or not this field must be filled-in before continuing to the next question. On the mobile device, a form with an empty required field may be saved as “incomplete” but not as “complete” and hence cannot be sent to your website.

Hide field in website – Controls whether the value generated by the widget will be displayed in the website. Allows you to store data in a field but not to display the field in the website. Commonly used to trigger relevance or skip logic conditions and also used in calculations.

Hide field in mobile app – Controls whether the widget will be displayed in the mobile app. Allows you to store data in a field but not to display the field in the mobile app. Commonly used to trigger relevance or skip logic conditions and also used in calculations. Note that since "As Received" auto-numbers are assigned by the website as data records are received they are not visible in the mobile app.

Have more questions? Submit a request

Comments

  • Avatar
    Andy Roden

    how do i change the auto-number from "when collected" to "As Received"

  • Avatar
    Duong

    Hi Andy - If everything goes as schedule, this new feature will be released next week. Thanks, Duong.

Powered by Zendesk