2

I am trying to create an item with relationship field with multiple references like this.

  $collection = new PodioCollection(array(
  new PodioItem(array('item_id' => 425989858)),
  new PodioItem(array('item_id' => 425987845))
  ));

  $response = PodioItem::create("16748745", array('fields' => array(
            "130415123"   => "+13334445552",
            "130415337"   => $collection
            )));

While creating item it shows error PodioBadRequestError: "Invalid value null (null): must be Range". I have only these two fields in this app.

I get the same error with single reference also.

$response = PodioItem::create("16748745", array('fields' => array(
            "130415123"   => "+13334445552",
            "130415337"   => array('item_id' => 425989858)
            )));

Any help?

arun kumar
  • 703
  • 2
  • 13
  • 33

1 Answers1

3

This one should work

$response = PodioItem::create("16748745", array('fields' => array(
            "130415123"   => "+13334445552",
            "130415337"   => array(425989858, 425987845)
            )));

I've tested this for Ruby code and that works well :)

created_item = Podio::Item.create(app_id, 
                                 'fields' => 
                                            {'title'        => 'just for test', 
                                             'relationship' => [item_1_id, item_2_id] })
Pavlo - Podio
  • 2,003
  • 2
  • 10
  • 19