2017-01-23 109 views
1

我一直在寻找这个解决方案,但还没有找到一个!我正在使用Novak solution's Infusionsoft APIInfusionsoft检索特定联系人的所有自定义字段值

我想要做的是获得特定联系人的自定义字段的值。可以说,我有一个名为_myCustomField的自定义字段,是/否值。我在列表中有200个联系人,但对于_myCustomField,只有15个联系人的值为'是'。可以说我有另一个自定义字段_myCustomField2。如果我运行下面的查询:

$contacts = Infusionsoft_DataService::query(new Infusionsoft_Contact(), array('_myCustomField' => '1')); 

我得到的15条记录的数组,但如果我打印$contacts数组,那么我看不出_myCustomField_myCustomField2那里。

那么,如何获得我的循环内的这两个自定义字段的值?有人可以帮我弄这个吗?

谢谢!

+0

看起来你只是无法正确输出信息,就像你说的,你得到的记录数组,但不能“打印”吧。请提供准确显示问题的代码。 – yuga

回答

1

查询方法的第二个参数只是过滤器,并且不会告诉Infusionsoft您还希望返回任何自定义字段。

你会希望先添加自定义字段:

$contact = new Infusionsoft_Contact(); 

$contact->addCustomField('_myCustomField'); 
$contact->addCustomField('_myCustomField2'); 

$contacts = Infusionsoft_DataService::query($contact, array('_myCustomField' => '1')); 
+0

谢谢!它的工作。 – arsS5