Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Update items by appItemId and appId #35

Open
LUS1N opened this issue Jun 23, 2017 · 0 comments
Open

Feature request: Update items by appItemId and appId #35

LUS1N opened this issue Jun 23, 2017 · 0 comments

Comments

@LUS1N
Copy link

LUS1N commented Jun 23, 2017

Disclaimer: I do understand that the podio api might be a limitation on this one.

I ran into this problem, that by only having AppItemId and not the global ItemId I can't run the update command so easily.

I made it out that I need to fetch the item first by calling GetItemByAppItemId(appId, appItemId) and then using the ItemId from the returned object.

When the returned item is big I couldn't even use the returned object in updating and had to extract the ItemId and make a new object with the value like so (although I agree that this is better when updating 1 field, it shouldn't be forced):

var item = new Item
{
    ItemId = podio.ItemService.GetItemByAppItemId(appId, appItemId).ItemId
};
item.Field<TextItemField>("my_field").Value = "-1";
podio.ItemService.UpdateItem(item, null, null, true);

Which could be done in the same way as in geting by app item id's

var item = new Item {AppItemId = appItemId};
item.Field<TextItemField>("my_field").Value = "-1";
podio.ItemService.UpdateItem(appId, item);

That would avoid the unnecessary GetItem call, but would require additional explanation that AppItemId is a required field of Item when calling this method.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant