Last active
May 5, 2017 07:46
-
-
Save davehax/48dcb71ec773345c9768b89af8fe9ee1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // code copied from here - http://camljs.codeplex.com/discussions/646023 | |
| // CamlJS library hosted here - https://github.com/andrei-markeev/camljs | |
| var dd1_values = ['dd1op1','dd1op2']; | |
| var dd2_values = ['dd2op1']; | |
| var dd3_values = ['dd3op1','dd3op2','dd3op3','dd3op4']; | |
| var dd1_expr_array = []; | |
| for (var i=0;i<dd1_values.length;i++) | |
| { | |
| dd1_expr_array.push( CamlBuilder.Expression().TextField("Category1").EqualTo(dd1_values[i]) ); | |
| } | |
| var all_expr_array = []; | |
| if (dd1_expr_array.length>0) | |
| all_expr_array.push(CamlBuilder.Expression().Any(dd1_expr_array)); | |
| if (dd2_expr_array.length>0) | |
| all_expr_array.push(CamlBuilder.Expression().Any(dd2_expr_array)); | |
| if (dd3_expr_array.length>0) | |
| all_expr_array.push(CamlBuilder.Expression().Any(dd3_expr_array)); | |
| var query = new CamlBuilder().Where().All(all_expr_array).ToString(); | |
| console.log(query); | |
| var dd1_expr = CamlBuilder.Expression().TextField("Category1").In(dd1_values[i]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment