Search code examples
emailfieldpodio

Set item email field in Podio


I'm having a hard time trying to guess how to set the item email field value, since there is nothing about this in the documentation (http://podio.github.io/podio-php/fields/)

I have tried :

$item->fields['email']->values = array("type"=>"work","value"=>"a@a.com");
$item->fields['email']->values = array("value"=>"a@a.com");
$item->fields['email']->values = "a@a.com";

$item->fields[$field_id]->value ="i@i.com";
$item->fields[$field_id]->type ="work";

$item->save();

Nothing works, please help! Thank you!


Solution

  • I have figured it out , here is the code that works (if anyone runs into the same problem)

    $field_id = 'email';
    $emails=$item->fields[$field_id]->values;
    $item->fields[$field_id]->values =array('value'=>"i@oooo.com",'type'=>'work');
    
    $item->save();