Skip to main content

Number attribute

Store an integer or decimal number

A Number attribute can store a single number to any amount of decimal places.

Configuration

When adding or editing a Number attribute on a design/interface, you can configure the following properties. These determine how the attribute will behave when users populate its value on corresponding items.

The properties of a Number attribute
  • Name * - enter a distinct name that clearly identifies the attribute.

  • Required - if enabled, the attribute will need to be populated with a value before the item can be saved. It can't be left blank!

  • Read-only - if enabled, the attribute can only be populated when creating items. It can't be edited later!

  • Unique - if enabled, the attribute won't accept a value that's already stored in the same attribute on another item of this design/interface.

  • Default value - the attribute will automatically be populated with this value, which can usually be changed before saving (unless it's Read-only or excluded from an item form).
  • Min - the attribute won't accept a value smaller than this number.

  • Max - the attribute won't accept a value larger than this number.

  • Decimal places * - enter the desired amount.

  • Tags - use the Tag Manager to select a custom tag or relevant system tag, such as:

    • Currency - the attribute will be displayed in your locale's currency, e.g. 234.5 will appear as £234.50.

    • Percentage - if the attribute is configured to hold a decimal value between 0 and 1, it will be treated as a percentage.

    • AutoIncrement - the attribute will be automatically populated on item creation. See below for details ⬇️.

Populate the attribute on items

When creating or editing an item, select the attribute to type in or paste a numerical value.

A Number attribute field

Auto increment

A design may benefit from having an incrementing Number attribute, which is set automatically for each new item. This can be added as a variable in the design's title/subtitle for easy identification.

For example, all jobs have an automatic Job Number attribute inherited from the standard Jobs interface, which is displayed in each job item's title.

An example job item showing its Job Number attribute in the title

To enable this behaviour when adding or editing a Number attribute on a design/interface:

  1. Select its Tags property, enable AutoIncrement and then select Save.

  2. Enable Required and Unique to ensure no items can receive the same number.

  3. Set Decimal places to 0 and leave these blank: Default value, Min, Max.

Be aware, this attribute won't be visible when creating/editing an item because it's set automatically. Existing items will receive the attribute when next edited (consider using a bulk action to Touch them).

How it works

If AutoIncrement is enabled on an attribute, an item of the Counters design is created, with its Number attribute set to 1.

During item creation, the AutoIncrement attribute is populated with the counter's number. The counter then always increments, even if item creation fails (e.g. due to lack of permission). This can result in numbers being skipped.

Counter items can be edited. In the Data Explorer, you can query the Counters design, and then edit the relevant item's Number attribute (or delete the item to restart at 1).

Note

The Counters items for the Defects, Inspections and Jobs interfaces can't be edited.

Caution

If a counter is lowered, and the AutoIncrement attribute has Unique enabled, subsequent item creation may fail with a DodiAttributeUniqueViolated error (E1522096537) due to clashing with existing items. However, repeated attempts will increment the counter each time, eventually reaching a unique number.