How to get a profile in the iOS SDK

Comments

9 comments

  • Official comment
    Sebastian Rehnby

    Hi Chris,

    I assume the "employee" field is an relationship/app reference field to an Employee app? If so, to set the employee relationship, just fetch the PKTItem object that you want to reference from the Employee app and set it as the value of the "employee" field, like:

    PKTItem *myEmployeeItem = ...;

    PKTItem *itemToCreate[@"employee"] = myEmployeeItem;

    You can now save the "itemToCreate" item. Does that solve your problem?

    For more info on how to use the relationship field and other field types in PodioKit, check the "Relationship field" section at http://podio.github.io/podio-objc/fields.

    Comment actions Permalink
  • Chris Mash

    I've managed to pull down the list of items in the 'People' app we also have, which duplicates the employee accounts. This serves the same purpose really but it would be interesting to know the answer to my question!

    0
    Comment actions Permalink
  • Sebastian Rehnby

    After reading your question again, is the "employee" field a contact field rather than a relationship field. If so, you need to supply a PKTProfile object as the field value, like:

    PKTProfile *contact = ...;
    itemToCreate[@"employee"] = contact;

    0
    Comment actions Permalink
  • Chris Mash

    That's the solution I switch to, initially I was trying to use podio user accounts but you don't seem to be able to get a list of those?

    0
    Comment actions Permalink
  • Chris Mash

    Yes Sebastian, it was a contact/profile, but there's no documentation/guidance for how create/populate a PKTProfile

    0
    Comment actions Permalink
  • Sebastian Rehnby

    The current beta version doesn't support that, but it might be pretty easy to add it. What would be your preferred way of looking up profiles from the API, i.e. which API call in the "Contacts" area (https://developers.podio.com/doc/contacts) would you use to find search for contacts? This is fairly application specific, so I am just trying to get an understanding of the use case.

    0
    Comment actions Permalink
  • Chris Mash

    I think we'd probably use 'Get space contacts' as the app is to integrate with a specific workspace and specific set of apps

    0
    Comment actions Permalink
  • Sebastian Rehnby

    Ok good to know. I'll try to get that added to the SDK in the next week or so.

    0
    Comment actions Permalink
  • Chris Mash

    Time flies... I can't see this functionality in PodioKit yet, did it make it in?

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk