Dynamic operators and comparisons


I’m currently developing a new feature, but i’m stuck…

I don’t find any solutions to allow my users to create their own conditions.

In my DB, i create a table “Conditions” and save from dropdown:

  • Operators (and, or)
  • Comparisons (<, >, =, ≥, ≤)
  • Variable
  • Number

And now i need to restructure these conditions dynamically in order to have a result true or false.

Any idea how to do that ?

Hey, Toolbox plugin is what you need to evaluate conditions based on the operators saved in the database.

Use “Expression” . It uses Javascript, so you need to use JS syntax. Place it somewhere on the page. Write your expression and use “Expression value” to print it out.
For example, if you need to Store AND, you gotta save it as && and OR as ||. If you need to check the Boolean value of AND-ing A and B and you have AND/OR field in your users table, you write it like this in the Expression

A Current page users AND/OR B

This will return True or False.
DM me if u need any help

Thanks ! I was completly blind by my project and didn’t find any solution !

Love !

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.