[英]PODIO php API call, get array offset of all item fields value using filter by app ID
[英]Podio PHP API - Filter item collection by calculated field value
我有一个带有外部ID has-email
的计算字段,如果该项目的email
地址不为空,则填充值为1
如果为空,则填充为0
)。
$filters = array (
'has-email' => 1
);
$attributes = array (
'filters' => $filters
);
$collection = PodioItem::filter( $app_id, $attributes );
我正在尝试获取仅包含电子邮件地址( has-email
值为1
)的项目的集合,但是,这将返回错误Podio Error Invalid value 1 (integer): must be object
。 如何过滤计算出的字段值?
您应该使用from
和to
键将值作为数组传递。 另外,请确保Podio中的Calculation字段has-email
的值是数字 (不是字符串)。
以下代码将返回has-email
值为1的项目
$filters = array(
'has-email' => array(
'from' => 1,
'to' => 1
)
);
下面的代码将返回has-email
值为0的项目
$filters = array(
'has-email' => array(
'from' => 0,
'to' => 0
)
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.