Using variables
In Hablla, when configuring an automation flow, you can use variables to retrieve data from previous components and expressions logical and conditional to make your automations more dynamic and intelligent.
This allows information to be reused automatically, without needing to fill it in manually, making the process more efficient and error-free.
🎯 What Are Variables in Hablla?
Each component within a flow has a unique code and can generate output data that can be used by other components in the same flow.

You can access this data using the following syntax:
➡ Real example:
If a component called whatsappReceptive_tmy0de identified a person, and their ID is stored in the field person.id, we can access this value like this:
If this component does not return a valid value, we can try a second component called whatsappReceptive_r2b7wr:
📌 Here, ?? means: if the first value is null or undefined, use the second.
🔥 Operators and Expressions in Hablla
In addition to accessing variables, you can use logical operators to create rules and conditions within your flows.
🛠 Logical and Conditional Operators
?? (Nullish Coalescing - "If null or undefined")
If the first value is null or undefined, use the second
{{$data?.componente1?.valor ?? $data?.componente2?.valor}}
|| (Logical OR - "Or")
If the first value is false (false, null, undefined, 0, ""), use the second
{{$data?.status || "Pendente"}}
: (Ternary operator - "If... then... else")
Works like a ternary operator (if/else)
{{$data?.idade > 18 ? "Maior de idade" : "Menor de idade"}}
&& (Logical AND - "And")
Returns the second value if the first is true
{{$data?.temDesconto && "Desconto Aplicado"}}
+ (Addition)
Adds two values.
{{5 + 3}} → 8
- (Subtraction)
Subtracts two values.
{{10 - 4}} → 6
* (Multiplication)
Multiplies two values.
{{3 * 4}} → 12
/ (Division)
Divides two values.
{{10 / 2}} → 5
% (Modulo)
Returns the remainder of the division.
{{10 % 3}} → 1
🔍 Comparison Operators
== (Equality)
Compares values without checking the type.
{{5 == "5"}} → true
=== (Strictly equal)
Compares values and data type.
{{5 === "5"}} → false
!= (Different)
Compares whether the values are different.
{{5 != "5"}} → false
!== (Strictly different)
Compares whether the values and types are different.
{{5 !== "5"}} → true
> (Greater than)
Returns true if the first value is greater than the second.
{{10 > 5}} → true
< (Less than)
Returns true if the first value is less than the second.
{{3 < 7}} → true
>= (Greater than or equal)
Returns true if the first value is greater than or equal to the second.
{{8 >= 8}} → true
<= (Less than or equal)
Returns true if the first value is less than or equal to the second.
{{6 <= 5}} → false
🔄 String Operators
+ (Concatenation)
Joins two strings.
{{"Olá, " + "mundo!"}} → "Hello, world!"
🔀 Array Operators
.length
Returns the size of an array.
{{$data?.nomes.length}}
.includes()
Checks whether a value exists in the array.
{{$data?.cidades.includes("São Paulo")}}
.map()
Iterates over the elements and modifies the array.
{{$data?.numeros.map(n => n * 2)}}
.filter()
Filters array elements.
{{$data?.numeros.filter(n => n > 5)}}
🔍 How to Use IF/ELSE Conditions
In Hablla, you can create conditional rules within flows. See how it works:
✅ Example 1: Check if a customer is qualified
If the lead score is greater than 50, the result will be "Qualified Lead", otherwise, "Unqualified Lead".
✅ Example 2: Set a default status
If the order status exists, it will be used. Otherwise, the default status "Processing" will be applied.
✅ Example 3: Combine multiple conditions
🔹 If the age is greater than or equal to 18, the result will be "Adult".
🔹 If the age is greater than 0, but less than 18, the result will be "Minor".
🔹 If the age is not provided, the result will be "Age not provided".
🎯 How to Use These Expressions in Component Configuration
Whenever you're configuring a component in Hablla, you can use these expressions in fields where you want to insert dynamic values.
📌 Practical example: Suppose we are creating a new card in the flow and want to associate a person identified in a previous component with it. We can do it like this:
This ensures that, if one component does not find the person, the other will be used automatically.
Best practices for using variables
When using variables in automation flows, it is important to understand the difference between unique identifiers and descriptive attributes.
Some fields represent characteristics of an entity and can change over time, such as:
Other fields exist specifically to identify an entity uniquely, such as:
Prefer id for permanent references
Whenever an automation needs to identify a specific entity — for example, a tag, person, list, department, card, or other object — prefer using the field id.
Example:
The id is the most suitable reference for automations that need to remain stable over time.
This prevents registration changes from affecting the flow logic.
Use descriptive attributes to compare values
Fields like name and std_name can be used normally when the automation's goal is to evaluate the current content of a property.
Example:
or:
In this case, the automation is deliberately comparing the value of that attribute.
The difference lies in the objective of the condition:
to identify a specific entity, use
id;to evaluate a characteristic of the entity, use the corresponding attribute.
Why is this important?
Descriptive attributes can change during the entity's lifecycle.
For example, a name can be edited later without the object ceasing to be the same.
The identifier still represents the same entity:
Therefore, an automation built based on the id tends to be more resilient to future changes.
Generic example
Consider an entity with the following data:
To permanently identify this entity:
To check whether the current name is "VIP Customer":
These are two different uses.
The first identifies the object.
The second compares a property of the object.
Recommended rule
To build more robust automations:
Whenever there is a id available and the intention is to reference a specific entity, it should be the preferred option.
Good practice: whenever you need to create a permanent reference to an entity within an automation, prefer using the field
id. Fields likenameandstd_nameshould be used when the intention is to compare their current values.
🔥 Summary: How to Use Variables and Expressions in Hablla
✅ Use {{$data?.codigoDoComponente?.caminhoVariavel}} to access data from previous components.
✅ Use ?? to define an alternative value if the first is null or undefined.
✅ Use || to define an alternative value if the first is false.
✅ Use : to create rules if/else within fields.
✅ Use && to define a value only if the condition is true.
🚀 With these techniques, you can create smart and personalized flows without needing to code!
Last updated
Was this helpful?

