Podio - PHP SDK - Item - how to filter on multiple fields
I have a Leads app with two text fields for primary phone and secondary phone. I need to filter the app by matching a phone text value either with the primary phone or with the secondary phone.
I tried this code to filter by primary phone first. If no items found, filter by secondary phone.
The filter only works for the primary phone only. Not with the secondary phone.
My code is:
// Get Lead ID search by main phone
$responses = PodioItem::filter($leadappid, $attributes = array('filters'=>array($primaryphone => $_REQUEST['From'])));
if ($responses->filtered != 0) {
$response = $responses[0];
$leadid = $response->item_id;
}
// Get Lead ID search by second phone
if ($responses->filtered == 0) {
$responses = PodioItem::filter($leadappid, $attributes = array('filters'=>array($secondaryphone => $_REQUEST['From'])));
if ($responses->filtered != 0) {
$response = $responses[0];
$leadid = $response->item_id;
}
}
Please sign in to leave a comment.
Comments
0 comments