Skip to content
Home » Mastering State Rules for Property Management in Your Application

Mastering State Rules for Property Management in Your Application

Mastering State Rules for Property Management in Your Application

In applications that require tracking the progress or status of various items, such as customer leads or project tasks, managing how these statuses can change is vital.
State rules offer a structured approach to controlling these status changes or state transitions of a property within an object, ensuring that each change follows your application’s logic and workflow.
This article explains the concept of state rules, outlines the steps to set them up, and illustrates their functionality through an example.
State rules are configurations within your application that govern the transitions between different states of a property in an object.

For example, a “Lead Status” or “Status” property might have states like New, Contacted, Working, Qualified, and Lost. State rules help ensure that transitions between these states adhere to defined business logic, such as only allowing certain user roles to mark a lead as Qualified.

Consider the following example where only certain role are allowed to convert to specific values

State Rules Diagram

How to Set Up State Rules

Choose the Object and Property

Start by selecting the object that has the property you want to apply state rules to.
Select the state property

Navigate to Property Settings

Find the property within the object and access its settings. Look for the “State Rules” section on the right-hand side.
Look for State Rules Toggle Button

Activate State Rules

Turn on the toggle button within the “State Rules” section to enable state rules for this property.
Enable Toggle Button

Define the Rules

Click on the “Edit State Rules” button that appears after enabling the toggle.

Click Edit State Rules Button
This action opens the “Create Transition Rules Form.”
State Rules window appears

Illustration: Setting Up ‘Status’ State Rules:

As an example, let’s set up state rules for a “Status” property, assuming there are roles like Sales Representative, Sales Manager, and Director (Sales) in the application.

In the Create Transition Rules window, you will fill out fields for “From State”, “To State,” and “Roles.”

In the From State, dropdown choose New. This option means that for the state rule to implement, the starting value of Status property should be New.

Choose New from Dropdown

Similarly in the To State, select Contacted. This option means that for the state rule to implement, the Status property should be changed to the value Connected.

Choose Connected from Dropdown

Under the Roles dropdown, select Sales Representative. This means that only the Sales Representative can carry out the state change.

Select Sales Representative from Dropdown

Multiple roles can be selected here to allow all of them to change the state.

Select Sales Representative from Dropdown

This configuration means that only users with the Sales Representative role are authorized to change a lead’s status from “New” to “Contacted.”

State Rule configured
To include additional state rules, simply press the “+ Add Rule” button.
Click Add Rule button for additional configurations

Note: Within the role selection dropdown menu, you’ll find a list of all roles that have been established in the application. Initially, the system provides three default roles to begin with: Admin, Contributor, and Guest. It’s possible to assign multiple roles the permission to change the state, allowing for flexible access control.

Implementing the Rules

Save the Rules: After setting up your state rules, click the “Save” button to apply them.
Apply State Rules

Update the Application: To ensure the state rules take effect, click the “Update App” button. 

Click Update App button

Confirm this update, which is necessary for the rules to become active within your application.

Confirm app updation

Demonstrating State Value Functionality During Record Creation

To illustrate how state values operate when creating a record, let’s consider adding a new record for the Lead Object. Here’s a scenario involving a sales representative:
Receiving and Entering a Sales Lead: A sales representative is tasked with handling a new sales lead. Initially, they will mark the lead’s state as “New” upon entry into the system.
New state

Updating the Lead’s State: After making contact with the lead and evaluating the interaction’s outcome, the sales representative will update the lead’s state to either “Contacted” or “Qualified“, depending on the lead’s potential for conversion.

As highlighted by the red box, the Sales Representative only has the authorization to change the State for “New” to either “Contacted” or “Qualified“. That’s because earlier we made the state rule as such.

States changes allow for Sales Representative

Restrictions on State Changes: When the lead reaches the “Qalified” stage, the sales representative’s ability to modify the state further is restricted. This is due to the predefined rules that grant only the sales manager the authority to move the lead from “Qualified” to “Converted“.

State rule for Sales Manager

Additionally, only the director (sales) is authorized to revert the lead from “Qualified” to “Lost“. 

State rule for Director Sales
This process demonstrates the practical application of state values in managing lead progression, emphasizing the role-based permissions that govern state transitions to ensure each lead is handled appropriately at every stage.
State rules are essential for maintaining the logical flow of status changes within your application. By clearly defining who can change the status of an item and under what conditions, state rules simplify workflow management, promote consistency, and ensure that your application’s data remains accurate and reliable.