Skip to main content
Version: 1.x

Bit form - Conditional Logic

Workflows in Bit Form, are a set of actions (Success Message, Redirect URL, Web Hook, Email Notifications, Integration, and field updates) that are executed when certain specified conditions are met. These rules automate the process of Success Message, Redirect URL, Web Hook, Email Notifications, Integration and field updates when a rule is triggered.

A workflow rule consists of the following elements:

1. Action Run When –

Specify when the rule should be triggered for a record .There are four options:

  • Record Create/Edit : Executes the rule when records are created and or existing records are modified. See the example below :
  • Record Create : Executes the rule when records are created. It’s doesn’t work for Edit, Delete. See the example below :
  • Record Edit : Executes the rule when existing record are modified. It’s doesn’t work for create, delete.
  • Record Delete : Executes the rule when certain records are deleted. Only Email Notifications and Webhooks can be associated for such a rule.

2. Action Effect –

On Form Load : The On Form Load action is used to dynamically alter a Form when it is loaded. The Form actions On Form Load is executed when the Form is loaded by a user.

When a page is loaded and you want to pre-filled some field value and can also run a workflow to update value, show, hide, disable and enable field.

There is two ways to pre-filled a value:

  1. Use a initial field value in field properties in the form builder (the feature will be added in the next update of plugin).

  2. Use the parameter in the URL.

  3. Parameter in the URL: website_url?field_api_name=field_value

Example: https://www.testpress.bitcode.pro/test/?b-1First_Name=a

Workflow action for On Form Load: on a form load while created or edited following action are available.

  1. Field value update

  2. Disable

  3. Enable

  4. Hide

  5. Show

See the example below:

In the above example, after the form loading First Name will be “Bitcode” and Last Name will be disabled. Many kinds of logic are used for On Form Load such as Equal, Not Equal, Is Null, Is Not Null, Contain, Not Contain, Greater Than, Less Than, Start With, Greater Than Equal, Less Than Equal, Start With, End With.

On Field Input : The On Field input is a client side action which will be called whenever the value of a field is modified either by the user . It is used to improve the usability of a form by validating field data even before it is submitted or display other field values based on the value specified in this field. The On Field input is executed before the changed data is persisted in the database.

When a form is created or edited an user/visitor put value in a field based on that you may want to trigger an action. Following actions are available for on field user input:

  1. Field value update

  2. Disable

  3. Enable

  4. Hide

  5. Show

See the example below:

In the above example, if First Name is equal “Bitcode” and Last Name is equal “Technology” then the Email will be bitcode@gmail.com. Many kinds of logic are used for on Field Input such as Equal, Not Equal, Is Null, Is Not Null, Contain, Not Contain, Greater Than, Less Than, Start With, Greater Than Equal, Less Than Equal, Start With, End With.

On Form Validate : This action is executed when a user submits the form to the server, before the user data is stored in the database. The script runs on the server side, and it has access to all the inputs the user entered. Only message can be associated for such a rule.

In the above example, if First Name Start With “B” or Last Name End Width “Y”, a message will be shown from the created confirmation message. Many kinds of logic are used for On Form Validate such as Equal, Not Equal, Is Null, Is Not Null, Contain, Not Contain, Greater Than, Less Than, Start With, Greater Than Equal, Less Than Equal, Start With, End With.

On Form Submit : On Form Submit is used to execute actions when a new record is successfully submitted to the database or when an existing record is updated or deleted from the database. It’s works on both situation when new data submitted or edit old data. Action on “On form submit” can be triggered with or without condition. The following actions are available in the On form submit:

  1. Success Message

  2. Redirect URL (does not work on edit)

  3. Web Hook

  4. Email Notification

  5. Integration

  6. Field value update.

See the example below:

In the above example, if First Name is Null And Last Name Is Not Null then a success message will be shown from the created confirmation message and the page redirect to “https://bitapps.pro/”. Many kinds of logic are used for On Form Submit such as Equal, Not Equal, Is Null, Is Not Null, Contain, Not Contain, Greater Than, Less Than, Start With, Greater Than Equal, Less Than Equal, Start With, End With.

Workflow condition : You can create multiple conditions in a workflow rule. Each condition consists of two elements. One is specifying which records should be triggered i.e. all records or the records that match the criteria. Another is adding the criteria based on which it should be triggered.

3. Action Behavior –

Always : The action in a workflow executes for all records by default when the action behavior field is set as Always.

Condition : Executes the workflow via conditional logic. Rule will be triggered for the records that meet the criteria.

In condition you can use many kinds of logic. Here’s some examples of condition:

In the above example, if the workflow is work, continent value is set to “Asia”. Although “language”=”bangla” is not match the workflow is working. Because firstly the workflow checks whether the first two conditions (“country”=”Bangladesh” and “City”=”Dhaka”) are met, if met then it’s check the next condition. We used OR logic for next condition. We setted “language”=”bangla” in workflow but filled up this field “english”. Since we used OR for this condition, if not the condition is met then the workflow will check the next condition. We used AND for the next condition. For this, it must be met, or the workflow will not work.

In the above example, if the workflow is work, continent value is set to “Asia”. Although the first two conditions (“country”=”Pakistan” and “City”=”Islamabad”) do not match the workflow is working. Because this time the workflow check the condition by group. Firstly the workflow checks whether the first two conditions (“country”=”Bangladesh” and “City”=”Dhaka”) are met, since we used OR after those two conditions, if not those conditions are met then the workflow will check the next condition. We uses OR logic for next condition. Then it checks whether the last two conditions are met. If match, the workflow will work.

In the above example, if the workflow is work, continent value is set to “Asia”. The workflow is not working. Because firstly the workflow checks whether the first two conditions (“country”=”Bangladesh” and “City”=”Dhaka”) are met, if match then it checks the next condition. We used OR logic for the next condition. Since we used OR for this condition, if not the condition is match then the workflow will check the next condition.

We used AND for the next condition. Since we used AND for this condition, for this, it must be met or the workflow will not work. We setted “Sea port”=”chittagong” in workflow but filled up this field “karachi”. This condition isn’t match, for this the workflow isn’t working.

#Calculation :

In Bit Form, you can use many kinds of mathematics calculations. Bit form allow Addition, Subtraction, Multiplication, Division. You can calculate via form fields value or custom value. See the example below :

In the above example, the sum of the two fields value is shown. If you want to calculate with field values, you have to follow the syntax. Here’s an example syntax : ${bf12-7-Electricity_Bill}+${bf12-8-Internet_Bill} . Start with the ‘$’ sign then have to wrap the field key in ‘{}’. Here’s ‘bf12-7-Electricity_Bill’ and ‘bf12-8-Internet_Bill’ are field keys.

Notice: Bit Form allows only the number field for calculation.

Loading...