react-awesome-query-builder
react-awesome-query-builder copied to clipboard
How to assign output to expression result?
Not a bug but a question.
I see how to build expressions using the editor, but how do I use the output of the expressions to assign return values?
For instance, take the following expression constructed from the query builder:
(vendor == ' Toyota' && year >= '2010')
How do I then use the query builder to express usage of the resulting output? As an example, how would I construct the following logic to set a variable "price"?
if (vendor == ' Toyota' && year >= '2010') then price = '20000' else price = '10000'
What format of output do you want to use for evaluating expressions? I assume you want to evaluate with JS, so probably SpEL or JsonLogic?
I'm more asking for the SELECT portion of the query. The query builder lets me define the WHERE portion of the query, but I'm not sure how to make use of it after I define it.
Building SELECT part of SQL is not supported, and I'm not sure about when I can implement this as it's not in priority