Problem using custom variables

I have problems using custom variables in linkage rules. Example:

  1. I have defined a custom variable with string value “yes” in the Event Flows of a page. The console log dumps the variable as an object:

{success: true, value: “yes”}

  1. In the Linkage Rules for a Block on the same page I can select the variable in the GUI, but the rule does not validate to true. Why?

  1. I even tried to check the variable to be equal to itself. This does also not work.

Hello, this variable returns an object, not a value, so it cannot be used like this. It is recommended to use this variable object in JS.

Okay, I understand the limitation now.

@hongboji please provide an alternative solution for this use-case:
I want to be able to set a variable with JS (for example during Event Flow on a page) that can be used in Linkage Rules via UI on the same page. How to do that?
(Reason: I have complex conditions that are easy to process in JS, and then I can simply set a variable to true/false that the UI can use to determine if something can be visible or not.)

JavaScript variables are complex structures that cannot be used directly in the UI. They need to be parsed and used in JavaScript. You can use them in a JavaScript block.

@hongboji I understand that variables can be many types and content, but in the UI for Linkage Rules I can select the previously defined JS-variable. This is indicating to me, that they are usable here.

I understand now that the JS-variable contains an object.
Why not letting the “value”-key of the object be usable in the Linkage Rules to check it against a boolean, numeric og string value? This would be very useful to build powerful rules. And while we are at that, why not being able to use JS in the Linkage Rules as a condition?