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
To refer to the value of a field, you don’t 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 email 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:
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:
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, email
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
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.