• Learn
  • Blog
  • Pricing
  • About
  • Sign in

Feature: Introducing calculated properties (video)

Use formulas to hide and validate fields, make buttons grayed-out, determine the recipients of reports and more through calculated properties. These formulas are evaluated when your app is run and make it possible to build far more dynamic, complex apps.

Support for calculated properties will finally ship with our March update. We have been working on this feature since late October and we’re thrilled to finally be on the verge of making it available.

A calculated property is a property whose value can either be determined when you design your app or when your app is run, by evaluating a formula. Properties are set using the inspector on the left-hand side and control various aspects of the selected item in the designer.

A regular property, such as the one determining whether a number is formatted with thousands separators, must be set when you design your app and can’t change when your app is run. A calculated property, on the other hand, can change when your app is run and can thus take into account input provided by your users. That enables you to, say, display a field only when a value exceeds a certain threshold or make a button enabled only when all required fields have been filled out.

Not all properties in the March update can be set using formulas, but most of the ones where doing so makes sense have been turned into calculated properties. Let us know if there’s a property that you’d like to see turned into a calculated property and we’ll consider it for a future release.

This is just the beginning of enabling you to create more dynamic, more complex apps. We have plans to add many more calculated properties in the future, enabling you to do things like making a field value green if the value is valid or making the entire app background red if a single field is invalid.

Referencing properties from formulas

Calculated properties can be referenced from other formulas. You reference a property of a field by typing the name of the field, followed by a period, followed by the property name. To make a button enabled only if Field1 and Field2 are visible, you can set the formula for its Enabled property to Field1.Visible && Field2.Visible (or AND(Field1.Visible, Field2.Visible)).

To refer to the value of a field, you don’t type Field1.Value, you simply type Field1. The value property of a field is the default property, meaning that if you don’t refer to a specific property, you implicitly refer to the value property. This means that all your formulas created using an older Calcapp version will continue to work and that referencing field values is easy and terse.

Not only fields and buttons have calculated properties. There are also calculated properties available for calculation panel groups, text boxes and list panel options. Number fields, date and time fields and e-mail buttons have additional calculated properties. Calculation panels and text panels also support properties. There’s complete information on the available properties in a separate blog post.

Changes to Calcapp Creator’s user interface

When adding new features, we try very hard not to let the new functionality weigh down the user experience by adding bloat and needless complexity. Our guiding vision for Calcapp Creator is that we want people familiar with spreadsheets to be able to create their first app in minutes, without reading our documentation.

As such, calculated properties are quite unobtrusive in the new user interface:

Calcapp Creator's new user interface supporting calculated             properties

There are two changes: there is a faint fx symbol next to calculated properties in the inspector and a drop-down box next to the name box in the formula bar. The drop-down box contains all properties of the currently selected item in the app designer:

The property box in Calcapp Creator

As a shortcut, you can also click the fx symbol next to the calculated property you’re interested in to change the formula.

In our first video tutorial, we build a registration form that asks the user to fill out his or her name, e-mail address and employer name and which makes heavy use of calculated properties. There is an additional field that asks the user for the number of employees that should only be made visible if the user provides an employer name. To accomplish this, we associate a formula with the Visible property of the CompanySize field that reads ISDEFINED(Employer), where Employer is the field where the employer name is filled out. ISDEFINED returns TRUE if and only if an employer has been provided, meaning that the CompanySize field is only made visible if there is an employer:

See the full video and the accompanying discussion or read about the new calculated properties we have added.

« Letter: Importing spreadsheets Feature: New calculated properties »