Skip to main content
Question

Quickbase php api - how to group multiple conditions in do query

  • June 23, 2018
  • 0 replies
  • 41 views

I need to query 2 multi select fields -
same field  should be OR condition and the other field should be in AND condition

As of now, it's working like 
(fid1 = value1 OR fid1 = value2 AND fid2 = value3 OR fid2 = value4)

I would like the query like
(fid1 = value1 OR fid1 = value2) AND (fid2 = value3 OR fid2 = value4)

array(0) {
    ["fid"]=>
    int(7)
    ["ev"]=>
    string(2) "EX"
    ["cri"]=>
    string(16) "Field Operations"
  }
  [2]=>
  array(1) {
    ["fid"]=>
    int(7)
    ["ev"]=>
    string(2) "EX"
    ["cri"]=>
    string(7) "Finance"
    ["ao"]=>
    string(2) "OR"
  }
  [3]=>
  array(2) {
    ["fid"]=>
    int(7)
    ["ev"]=>
    string(2) "EX"
    ["cri"]=>
    string(17) "Global Operations"
    ["ao"]=>
    string(2) "OR"
  }
  [4]=>
  array(3) {
    ["fid"]=>
    int(7)
    ["ev"]=>
    string(2) "EX"
    ["cri"]=>
    string(30) "Human Resources/Communications"
    ["ao"]=>
    string(2) "OR"
  }
This topic has been closed for replies.