Field Rules and Actions

Field Rules and Field Actions fall under the same category. Their differences are minor in our current version of Blocworx. For the sake of the documentation we will only use the term "Rule".

For more information on Rules vs Actions click here to get to bottom of the page.

What is a rule?

A rule is a piece of activity that occurs when data inside a field changes and when the form is submitted. You can set this piece of activity and you can decide if its a rule that can or cannot be broken.

Our most basic and easy to understand rule is the following: Cannot Be Empty This rule simply forces to user to fill data into a field. If they attempt to submit a form with a field that has this rule, and the field is empty, the rule will break.

A more advanced rule would be Populate local field with part of this field In this rule, once the data in the field is entered another local field gets populated with a part of the data in this field that you will have predefined in the rule parameters.

How to add a rule to a field

To do this, having created a field, you simply hover over that field and click "Rules". This will open the right hand sidebar and will bring you straight to the rules.

How to trigger a rule

The way rules are triggered can vary slightly depending on the type of field. On Text or Large Text fields, rules get triggered when you hit enter or tab on the keyboard (or if a scanner has been programmed to do this). On button/click type fields they get triggered when you click. In other fields they get triggered simply when the value in the field changes.

Response Types & Response Data

You can choose the type of response the rule gives back when triggered.

Red Warning Reject

Red Warning Rejects completely disallow you to submit the form. It also clears the data from the field.

Yellow Warning Accept

The Yellow Warning Accept options allows the user to continue and does not delete the data.

No Warning Accept

Visually this option means nothing happens on the screen and you can continue. Why have this option at all? Because of the next feature in rules, which is Rule Response Data. Sometimes we may want to get a response from a rule and fill certain fields with certain values based on whether a rule passes or not.

Rule Response Data

Using this feature, we can populate certain fields on our Bloc depending on the outcome of the rule.

Populate Other Field Data on Rule Passing

If the rule is not broken then we can opt to add values to other fields.

Populate Other Field Data on Rule Failure

If the rule is broken then we can opt to add different values to other fields.

Custom Rule Response

Each Rule has a default Blocworx built-in response message depending on the rule. However sometimes these responses might seem a bit technical or may not make sense to a user in the context of the form. For this reason you can set your own custom responses.

Multiples Rules and Rule Order

You can add as many rules to a field as you like. The order in which they are executed are determined by the rule order. It is important to note that all rules get processed even if one breaks. This is to allow you to carry out more than just one activitiy on a field. The rule order can be used for instant to check multiple blocs for different data and if they all contain response data, the last rule which has response data will be the one that is used.

Rules vs Actions

As our software got more advanced, and as our rules got more advanced beyond simply checking data and passing/failing rules, we started putting more features and more settings into existing rules, for example: Populate another local field with total from elsewhere

This rule has the ability to count data in various ways in other blocs (or even the same bloc) and give back this data as a numeric quantity. It can even check the data in more advanced ways by handling more criteria for counting. A rule like this is closer to being an "Action" rather than a rule.

In the future, we will be officially splitting the rules from the actions, allowing us to add even more features to just one while not adding it to another.

Last updated