Skip to content

Feature request: Update items by appItemId and appId  #35

Description

@LUS1N

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions