Where in clause

I need to run a custom sql query on a single table that involves the WHERE pic_id(integer) IN {list of integer values here}.

I can’t find any way of doing this.

Thank you

The ‘IN’ operator is supported.

‘IN’ - Checks for equality against any member in set provided, if found returns TRUE. Requires a comma-delimited set surrounded by parenthesis, i.e. a IN (1,2,3).

Docs here have more info on retrieving records with filters: https://wiki.dreamfactory.com/DreamFactory/Features/Database/Records#Retrieving_Records

1 Like

Thank you. I have one more issue.

the following filter works when using the api docs on my example_relationship table:
(example_field=example) and (example_field2=(10))

but when written down in a php server script like this :

$var1 = “example”;
$var2 = 10 ;
$filterData = [“filter” => ‘(example_field=’.$var1.’)) AND (example_field2=(’.$var2.’))’ ];
$tableGetCall = $get(“mysql/_table/example_relationship” , $filterData);

It only returns values as if AND clause wasn’t there. It only matches example_field=example.

Thank you.

Probably need to URL encode the spaces. I believe API Docs does this for you in the example CURL call that is provided when you “try it out”