dsQuery OR frustration

dsquery

(Datta Groover) #1

I’ve read that dsQuery doesn’t do OR. Is that true? What’s the work-around?

This is working for me:

$returnFields = array(‘GroupCategoryId’,‘GroupDescription’,‘GroupName’, ‘Id’);
$query = array(‘Id’ => $allGroups, ‘GroupCategoryId’=> ‘48’);
$contacts = $app->dsQuery($Table,100,0,$query,$returnFields);

BUT I need it to return 3 Group categories: 48, 50, and 6o.
The only way I thought of was to loop the entire query so it runs once with each GroupCategoryId, but that seems pretty backwards.

Do I need to move on from the legacy API?


(Yuga E.) #2

Passing over these parameters in an array should work fine. For example, ‘GroupCategoryId’ => [48, 50, 60].

You may see more query options documented here:
DataService.query documentation


(Datta Groover) #3

Um, that was it. I’m feeling kind of dumb because I thought I’d tried that, but obviously not.
Thanks!