You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, the library supports 'some', 'all' and 'none' operators exposed by JSONLogic. While this works fine for most scenarios involving lists or arrays, there are certain gaps here in case we need to filter the array first and then apply the rules. Taking the cars example showcased here again: https://ukrbublik.github.io/react-awesome-query-builder/
Supported Scenario:
Check if all car objects meet the rules
Check if at least 1 car object meet the rules
Check if no car object that meet the rules
Check if car objects has n objects that meet the rules
Unsupported Scenario:
Check if all cars where Vendor = Ford meet the rules
The use case of filtering before we apply the rules would be pretty powerful when we have a complex nested structure
Describe the solution you'd like
I've tried playing around with custom operators and it doesn't seem straightforward to implement this (please correct me if I'm wrong here). I feel the current rule-group should have a 'add filter' option which allows nested rules and then it should allow additional rules that apply on the filtered list.
Map feature could also work in a similar fashion if need be
Describe alternatives you've considered
The only way I can see right now to enable something like this is to break my rules into 2 pieces. The first piece will only support 'filter' and as filter returns a list of array. That list has to be programmatically passed in as input data to the next jsonlogic rule which would evaluate to a TRUTHY or FALSY output
Additional context
If there is an easy way to enable something with existing config, I'd appreciate an example. Appreciate the support for this library!
The text was updated successfully, but these errors were encountered:
@ukrbublik any thoughts on if this can be added as an enhancement or somehow can be done with existing capabilities?
Would really make life easy when we're working with complex array objects of different types as you could filter what you need and then apply the rules. I understand this can be done programmatically as well but would be neat if we could leverage JSONLogic's inbuilt Filter function
This can be added as an enhancement.
I don't think there is a good way to achieve this using existing capabilities.
We need to clearly distinct filter and condition queries (red and blue ones in your screenshot) for rule-group which is not yet possible.
Is your feature request related to a problem? Please describe.
Currently, the library supports 'some', 'all' and 'none' operators exposed by JSONLogic. While this works fine for most scenarios involving lists or arrays, there are certain gaps here in case we need to filter the array first and then apply the rules. Taking the cars example showcased here again: https://ukrbublik.github.io/react-awesome-query-builder/
Supported Scenario:
Unsupported Scenario:
The use case of filtering before we apply the rules would be pretty powerful when we have a complex nested structure
Example:
JSONlogic supports this with their filter operator - https://jsonlogic.com/operations.html#map-reduce-and-filter
As example JSONLogic rule and input data is given below:
JSON Logic Rule: (Filter Cars list on vendor == Ford THEN check year == 1990)
Example Data that passes above:
Describe the solution you'd like
I've tried playing around with custom operators and it doesn't seem straightforward to implement this (please correct me if I'm wrong here). I feel the current rule-group should have a 'add filter' option which allows nested rules and then it should allow additional rules that apply on the filtered list.
Map feature could also work in a similar fashion if need be
Describe alternatives you've considered
The only way I can see right now to enable something like this is to break my rules into 2 pieces. The first piece will only support 'filter' and as filter returns a list of array. That list has to be programmatically passed in as input data to the next jsonlogic rule which would evaluate to a TRUTHY or FALSY output
Additional context
If there is an easy way to enable something with existing config, I'd appreciate an example. Appreciate the support for this library!
The text was updated successfully, but these errors were encountered: