Saltcorn 0.9.2 - No-coding actions

By Tom Nielsen
Published on 

In the last blog post I wrote that we would not release new major features over the 0.9.x release cycle. Well, as John Lennon said, life is what happens while you are busy making other plans. And I am glad it did, because we had slipped into a necessity of writing code to build realistic applications. With new facilities in place, we can reclaim the no-code label. 

With the release of Saltcorn 0.9.2 we have made a huge progress in the way we address actions. We've always been able to use point and click, drag and drop to construct applications with create, read, update and delete (CRUD) database operations - and our focus on relational structure meant these interfaces could be highly complex and integrate information from multiple tables. But when it came to actions to make API calls or manipulate database rows beyond simply editing fields from user input, we often had to resort to actions written with JavaScript code or the scratch-like blocks.

This changes in this new release because you now both gain much more flexibility and that flexibility can be achieved without writing any code. We are introducing four changes that make this possible:

Multi-step actions: in response to a button click you can now perform multiple actions each of which can be configured independently. This is a simple change that enormously increases the flexibility of what can be achieved in a UI.

Navigation actions: to fully exploit the possibilities in multi-step actions, we are introducing a series of actions that direct elementary user interface operations. You now have individual actions that correspond to loading pages, opening and closing modals, sending user notifications, or setting form fields.

View reloading action: we are introducing a new action for find grained control over the display state: an action that reloads any embedded view. previously we have often done a full page reload whenever the data has changed. This ensures the data is displayed up to date but has the disadvantage of losing the users position in any other views on the same page. Now as part of a multi-step action you can specify that a specific view should be reloaded, meaning that the rest of the page is left alone. The result is that you can achieve levels of interactivity much closer to custom-built single-page applications.

Finally we are releasing a copilot module that allows you to create actions (and other things!) by describing them with natural language. This will be announced in the next few days, stay tuned!

For further improvements in fine grained interactivity, Filter views can now use the view state in a show-if formula in its containers. This means that you can render parts of a filter conditionally based on other filter states. Other views can also use the state in their formula for additional interactivity options.

We have had a huge push to accommodate more flexible graphical designs. There is a new theme in development in the module store, metronic, based on a commercial theme for which you will need to obtain a license if you would like to use it. Themes now have a greater degree of control of the Saltcorn rendering engine in how individual elements should be displayed. There's also now a tab for themes in the welcome view when you first login, to highlight that display flexibility.

Triggers can now be defined on validate events which are run before inserts or updates on database tables. Validate events can return an error in which case the insert or update is aborted. They can also return a direction to set field values in the row. These types of triggers allow you to do very complex validation logic that requires retrieving other rows, possibly from other tables.

Date fields can now be configured as only representing days (with no time). This is important when filtering on boundary dates such as start and end times where you want to control whether these boundaries are inclusive or exclusive.

There are some further smaller improvements:

Progress bars can now be radial which gives you a modern circular display.

Most data types now have a field view show_with_html that allows you to write HTML with interpolation using handlebars to retrieve the value. You can now also use interpolation in embedded HTML code in show views to retrieve the row values.

The configuration is now part of the snapshot to increase the reliability of using this as a method to synchronize development and production instances.


Recent posts