mistic100 / jQuery-QueryBuilder

jQuery plugin offering an interface to create complex queries

Home Page:https://querybuilder.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Autofill rules from a CSV

AshrithSher opened this issue · comments

First of all, I really appreciate you all for the super great work you people have been doing.
I have values of rules in a CSV file. Whenever I upload a CSV file, my rule's fields should be auto populated with values from that particular CSV file. I did some research and thought setrules might help but I either need an SQL query or JSON to auto-populate using setRules or using setRulesFromSQL. I need your help in auto-generating that SQL query with values from my CSV so that I can use setRulesFromSQL or some other optimised solution to solve my issue.
It would mean a lot if you could help me in this regard, thanks in advance.

I got this resolved myself. I read the filter names, operators and values as a 3D matrix from the CSV file and use setRulesFromSQL. Please let me know if you guys have any optimised solution. Thanks a lot again for providing us with such great plugins and all. Thank you.

I would have used "getRules", there is no point in using "setRulesFromSQL" which will simply parse the SQL and call "getRules" itself. You are only multiplying the source of potential errors.

The paylod expected by "setRules" is documented https://querybuilder.js.org/#method-setRules => "See an example"