When using a Custom Event within Bubble.io, an unexpected behavior occurs where the boolean logic of a condition is inverted. That is, a check that should return YES is returning NO, and vice versa, when used within a Custom Event.
Context:
- The error occurs when passing a boolean value as a condition to a Custom Event.
- When the condition is tested outside the Custom Event, the return is correct.
- Within the Custom Event, the value is inverted for no apparent reason.
- This directly impacts workflow logic, potentially causing critical errors in applications that rely on precise boolean checks.
Steps to Reproduce:
- Create a Workflow in Bubble with the following configurations:
- Create a Custom Event named
verificaPreCadastro
. - Create a boolean condition in the main Workflow before calling the Custom Event:
Search for preCadastro (uniqueId = LocalStorage's First Item (uniqueId)) First item is not empty
* **If TRUE**, call `verificaPreCadastro`.
- Inside the Custom Event, repeat the same verification for debugging:
Search for preCadastro (uniqueId = LocalStorage's First Item (uniqueId)) First item is not empty
- Add an Alert to display the result.
- Test the workflow:
- When the verification is done before calling the Custom Event, the value returns correctly.
- When the same calculation is performed inside the Custom Event, the value returns inverted.
Evidence and Screenshots:
-
Initial Workflow - Structure showing the expected logical sequence of the flow.
-
Value stored in LocalStorage - Showing that
uniqueId
is correct.
-
Workflow execution on the page - Confirming the retrieval of the stored value.
-
Database search verification - Showing that
preCadastro
was correctly located (YES
).
-
API call and workflow - Showing that the values are correct in the request.
-
Conditional in Custom Event - Showing that it should be triggered (
YES
), but it is incorrectly interpreted asNO
.
-
Custom Event execution - Showing that the logic was inverted.
-
Inverted verification - If the logic is changed (
is empty
instead ofis not empty
), the result is also inverted.
-
Final conclusion - The Custom Event is always inverting the boolean value.
Expected Behavior: The boolean value passed to the Custom Event should be preserved and not inverted.
Current Behavior (Bug): Inside the Custom Event, the value is inverted, meaning:
YES
becomesNO
.NO
becomesYES
.
Identified Workarounds:
- Manually invert the logic inside the Custom Event to work around the bug.
- Create an intermediate variable (Custom State) and use it inside the Custom Event instead of recalculating the condition.
- Add a short delay before calling the Custom Event to ensure values are processed correctly.
Impact: This bug can severely affect applications that depend on boolean checks for workflow control, security, and data validation, potentially causing incorrect results and unexpected actions within the system.
Request: We request that the Bubble team investigate and fix this unexpected behavior, ensuring that boolean values are maintained correctly within Custom Events.
Attachments:
- Screenshots demonstrating the inversion of values.
- Logs from the Bubble debugger showing the correct values before entering the Custom Event and the inverted values inside it.
- Short video demonstrating the workflow execution with the bug occurring.
We look forward to your response and are available for any further clarifications.