Data in agileBase

Smart fields – automatic generation of field values

This feature lets you automatically pre-populate field values for new records, using calculations or lookups.

Here are a couple of uses that trial customers have already found:

  1. For a purchase order app, when entering a new purchase order, the system looks up the previous price and quantity purchased and pre-populates them. This makes repeat orders really easy and also lets the purchaser see whether the item’s getting cheaper or more expensive.
  2. In a centralised system for a large group of companies, with central oversight by the common owner, invoice numbers and job numbers need to be given their own unique IDs, however they also must be sequential within a company. So for example, company A might have numbers A0001, A0002, A0003 etc. and B may have B0001, B0002, B0003. A smart field lets us look up the company the logged in user belongs to, find the sequence for that company and create a new number with the relevant prefix.

How does it work?

We build on a feature that already exists – referenced fields. In brief, a referenced field pulls in one or more fields or calculations from a view into a table form. The view can be any view in the system, as long as it contains the ID field from the table it’s in, so it can select the right record.

We simply use the value pulled in to populate a standard field.

Once you have a referenced field, drag it up to just above the field you want to populate. Then in the options for the field you want to populate, select ‘Set from previous referenced field’.

When the user creates a new record, the value from the referenced field will automatically populate the field under it. The referenced field itself will become invisible.

To auto-populate a relation field, there’s a slight difference. In the view for the referenced field, add in a field or calculation to display the value to the user. This should have the same name as the ‘display value’ option of the relation field, e.g. if you’re relating to a company it may be ‘company name’. Then after that, add in a calculation for the internal row ID of the record which should be attached.


Last modified October 16, 2023: Update _index.md (1576450)