Post

4 followers Follow
0
Avatar

Multiple Relationship on Item

I have 2 apps, passengers and reservations. I need to add passengers to the reservation through a relationship field inside the reservation app. Im using Podio's API for this.

The problem:

A reservation item should accept multiple passengers in the same field, but when I try to add an Array of passengers IDs that I have already created, I get an error message "Invalid value (array): must be integer". It only accepts one item_id_of_reference.

Is there a way I can add various items IDs to a relationship field through Podio's API? How?

 

David Mesa

Please sign in to leave a comment.

2 comments

2
Avatar

Hey David,

Definitely you can add multiple related items!

Items should be provided as list of dictionary/hashes of values, f.ex:

field_name :[{value: 1}, {value: 2}, {value: 3}]

where 1, 2, 3 are item_ids of item that you wish to add.

Let me share a tip: Because Podio website uses the same API as available to clients you can peep at the correct request performed by front-end (using. f.ex developer tools) - please see attached screenshot (and enjoy my photoshop skills!)

Jakob Pułczyński 2 votes