Post

1 follower Follow
0
Avatar

Updating items using item id

Hello!

Im currently working on a project that requires updating an item in one of our apps that matches a string, that is a variable that we get on an external application. I have been using the API and php client. I know i have to use the update function, but i dont know how to get the item id of the item that includes the string im looking for to make the update work. Any advice? Is that possible? 

I´m not a professional coder, so any help would be highly appreciated.

 

Cheers!

Sergio Giraldo Answered

Please sign in to leave a comment.

5 comments

0
Avatar

If you are storing the string as an external_id on the item use filterItems to get the item with that external_id. If you are not storing your string as the external_id start doing so :)

The exception being: If you are manually creating these items you cannot set the external_id. If your string is numeric save it to a Number field and use filterItems to find it again.

If it really is a string and you can't use external_id: Use the search in app API call to search for the string.

Andreas Haugstrup Pedersen 0 votes
Comment actions Permalink
0
Avatar

That way I can retrieve the item_id parameter that the update function is requiring? My process ensures that the ID that im passing on a variable exists on an item in my Podio app. How can I just fetch the item_id into a variable?

 

Thanks for the quick response :)

Sergio Giraldo 0 votes
Comment actions Permalink
0
Avatar

Did you try it? filterItems returns the full item, item_id included.

If you already have an item_id you can just try to get the item using getItem or getItemBasic. They will complain if the item doesn't exist.

Andreas Haugstrup Pedersen 0 votes
Comment actions Permalink
0
Avatar

Sorry for posting this, but this is what I get when i print the array that contains the result from the function getItems() with the ID i provide as the main filter. I need to retrieve the value of the item_id (which is 17891884). How can I get that value into a variable in PHP? Sorry for the inconvenience, not too much of a coder :P 

 

Array ( [0] => 1 [1] => 2 [2] => Array ( [0] => Array ( [link] => https://aiesecincolombia.podio.com/outgoing-exchange/item/17891884 [last_event_on] => 2012-09-27 23:14:25 [item_id] => 17891884 [ratings] => Array ( [like] => Array ( [average] => [counts] => Array ( ) ) ) [rights] => Array ( [0] => view [1] => update [2] => delete [3] => subscribe [4] => comment [5] => rate [6] => add_file [7] => add_task [8] => add_conversation [9] => grant ) [fields] => Array ( [0] => Array ( [status] => active [external_id] => title [config] => Array ( [description] => Type the EP ID [settings] => Array ( [size] => small ) [required] => 1 [mapping] => [label] => EP ID [visible] => 1 [delta] => 0 ) [field_id] => 12515941 [label] => EP ID [values] => Array ( [0] => Array ( [value] => EP-In-CO-CA-2012-1745 ) ) [type] => text ) [1] => Array ( [status] => active [external_id] => ep-name [config] => Array ( [description] => [settings] => Array ( [referenceable_types] => Array ( [0] => 1653513 ) ) [required] => 1 [mapping] => [label] => EP name [visible] => 1 [delta] => 1 ) [field_id] => 12515940 [label] => EP name [values] => Array ( [0] => Array ( [value] => Array ( [item_id] => 17891844 [link] => https://aiesecincolombia.podio.com/outgoing-exchange/item/17891844 [app] => Array ( [status] => active [name] => Raising and Legalization [url] => https://aiesecincolombia.podio.com/outgoing-exchange/apps/raising-and-legalization [url_label] => raising-and-legalization [space_id] => 436941 [link_add] => https://aiesecincolombia.podio.com/outgoing-exchange/apps/1653513/items/new [app_id] => 1653513 [item_name] => input [link] => https://aiesecincolombia.podio.com/outgoing-exchange/apps/raising-and-legalization [config] => Array ( [item_name] => input [icon_id] => 157 [type] => standard [name] => Raising and Legalization [icon] => 157.png ) [url_add] => https://aiesecincolombia.podio.com/outgoing-exchange/apps/1653513/items/new [icon_id] => 157 [icon] => 157.png ) [initial_revision] => Array ( [created_on] => 2012-09-27 23:12:35 [created_by] => Array ( [user_id] => 819564 [avatar] => 18752981 [name] => Paola Oliva [url] => https://podio.com/users/819564 [avatar_id] => 18752981 [image] => Array ( [perma_link] => [hosted_by] => podio [hosted_by_humanized_name] => Podio [thumbnail_link] => https://d3szoh0f46td6t.cloudfront.net/public/18752981 [link] => https://d3szoh0f46td6t.cloudfront.net/public/18752981 [file_id] => 18752981 ) [type] => user [id] => 819564 [avatar_type] => file ) [created_via] => Array ( [url] => [display] => [id] => 1 [name] => Podio Development ) [user] => Array ( [user_id] => 819564 [avatar] => 18752981 [name] => Paola Oliva [url] => https://podio.com/users/819564 [avatar_id] => 18752981 [image] => Array ( [perma_link] => [hosted_by] => podio [hosted_by_humanized_name] => Podio [thumbnail_link] => https://d3szoh0f46td6t.cloudfront.net/public/18752981 [link] => https://d3szoh0f46td6t.cloudfront.net/public/18752981 [file_id] => 18752981 ) [type] => user [id] => 819564 [avatar_type] => file ) [type] => creation [revision] => 0 ) [title] => Alejandra Aragon Sinisterra ) ) ) [type] => app ) [2] => Array ( [status] => active [external_id] => ep-manager [config] => Array ( [description] => [settings] => Array ( [valid_types] => Array ( [0] => user ) ) [required] => 1 [mapping] => [label] => EP Manager [visible] => 1 [delta] => 2 ) [field_id] => 12516190 [label] => EP Manager [values] => Array ( [0] => Array ( [value] => Array ( [skype] => paolaoliva1 [user_id] => 819564 [name] => Paola Oliva [zip] => Cali [rights] => Array ( [0] => view ) [external_id] => [image] => Array ( [perma_link] => [hosted_by] => podio [hosted_by_humanized_name] => Podio [thumbnail_link] => https://d3szoh0f46td6t.cloudfront.net/public/18752981 [link] => https://d3szoh0f46td6t.cloudfront.net/public/18752981 [file_id] => 18752981 ) [profile_id] => 23876409 [mail] => Array ( [0] => paola.oliva@aiesec.net ) [phone] => Array ( [0] => +57 3005375047 ) [link] => https://podio.com/users/819564 [avatar] => 18752981 [country] => Colombia [title] => Array ( [0] => LCVP oGCDP AIESEC Cali ) [type] => user [last_seen_on] => 2012-10-18 18:26:31 ) ) ) [type] => contact ) [3] => Array ( [status] => active [external_id] => matching-status [config] => Array ( [description] => [settings] => Array ( [multiple] => [options] => Array ( [0] => Array ( [status] => active [text] => Searching TNs [id] => 1 [color] => DCEBD8 ) [1] => Array ( [status] => active [text] => Interview process with the TN [id] => 2 [color] => DCEBD8 ) [2] => Array ( [status] => active [text] => AN sent [id] => 3 [color] => DCEBD8 ) [3] => Array ( [status] => active [text] => Matched! [id] => 4 [color] => DCEBD8 ) ) ) [required] => 1 [mapping] => [label] => Matching status [visible] => 1 [delta] => 3 ) [field_id] => 12516191 [label] => Matching status [values] => Array ( [0] => Array ( [value] => Array ( [status] => active [text] => Matched! [id] => 4 [color] => DCEBD8 ) ) ) [type] => category ) ) [title] => EP-In-CO-CA-2012-1745 [initial_revision] => Array ( [created_on] => 2012-09-27 23:14:25 [created_by] => Array ( [user_id] => 819564 [avatar] => 18752981 [name] => Paola Oliva [url] => https://podio.com/users/819564 [avatar_id] => 18752981 [image] => Array ( [perma_link] => [hosted_by] => podio [hosted_by_humanized_name] => Podio [thumbnail_link] => https://d3szoh0f46td6t.cloudfront.net/public/18752981 [link] => https://d3szoh0f46td6t.cloudfront.net/public/18752981 [file_id] => 18752981 ) [type] => user [id] => 819564 [avatar_type] => file ) [created_via] => Array ( [url] => [display] => [id] => 1 [name] => Podio Development ) [user] => Array ( [user_id] => 819564 [avatar] => 18752981 [name] => Paola Oliva [url] => https://podio.com/users/819564 [avatar_id] => 18752981 [image] => Array ( [perma_link] => [hosted_by] => podio [hosted_by_humanized_name] => Podio [thumbnail_link] => https://d3szoh0f46td6t.cloudfront.net/public/18752981 [link] => https://d3szoh0f46td6t.cloudfront.net/public/18752981 [file_id] => 18752981 ) [type] => user [id] => 819564 [avatar_type] => file ) [type] => creation [revision] => 0 ) [current_revision] => Array ( [created_on] => 2012-09-27 23:14:25 [created_by] => Array ( [user_id] => 819564 [avatar] => 18752981 [name] => Paola Oliva [url] => https://podio.com/users/819564 [avatar_id] => 18752981 [image] => Array ( [perma_link] => [hosted_by] => podio [hosted_by_humanized_name] => Podio [thumbnail_link] => https://d3szoh0f46td6t.cloudfront.net/public/18752981 [link] => https://d3szoh0f46td6t.cloudfront.net/public/18752981 [file_id] => 18752981 ) [type] => user [id] => 819564 [avatar_type] => file ) [created_via] => Array ( [url] => [display] => [id] => 1 [name] => Podio Development ) [user] => Array ( [user_id] => 819564 [avatar] => 18752981 [name] => Paola Oliva [url] => https://podio.com/users/819564 [avatar_id] => 18752981 [image] => Array ( [perma_link] => [hosted_by] => podio [hosted_by_humanized_name] => Podio [thumbnail_link] => https://d3szoh0f46td6t.cloudfront.net/public/18752981 [link] => https://d3szoh0f46td6t.cloudfront.net/public/18752981 [file_id] => 18752981 ) [type] => user [id] => 819564 [avatar_type] => file ) [type] => creation [revision] => 0 ) [priority] => 17891884 [comment_count] => 0 [file_count] => 0 [external_id] => ) ) )

Sergio Giraldo 0 votes
Comment actions Permalink
0
Avatar

This is not the best place to learn PHP. It think it would be helpful if you check out some PHP tutorials as it will you a base to build upon when you work with the Podio API. Jumping into the Podio API PHP client without knowing any PHP is like trying to run a marathon before you've learned to walk. There are many excellent learning resources for PHP out there.

In this case if you have stored the result in the variable $result you would find the item id in:

$item_id = $result[2][0]['item_id']

Andreas Haugstrup Pedersen 0 votes
Comment actions Permalink