Retrieving aggregated data through API (maybe using widgets)

Answered

Comments

6 comments

  • Andreas Haugstrup Pedersen

    Answering this at the same time: https://help.podio.com/entries/23730493-Retrieving-all-the-data-from-an-application-in-a-excel-format

    For larger excel exports you need to use: https://developers.podio.com/doc/items/export-items-4235696 -- you can provide a set of filters the exported items must match.

    It will return a batch_id which refers to the batch job that will be managing your export. I don't know how that will work with klipfolio -- you'll have to contact them to hear how their integration works. We cannot provide synchronous access to excel exports of large datasets for performance reasons. That's why you get a batch_id returned.

    All the best,

    Andreas 

    0
    Comment actions Permalink
  • Juan

    Thanks Andreas, 

    I don't think that would work with Klipfolio's API. That is why I was asking if there was a way to retrieve the data from a widget. Because that's exactly what I need. 

    I would need a URL in which I would have to include the widget_id, which I haven't been able to find.  

     /widget/{widget_id}/....something that indicates that i want the data in a format such as Excel, JSON, XML...

    I am not at all an advance user but i am trying to put together this to great apps because there is so much potential in it, for my company.

    Thanks!

    0
    Comment actions Permalink
  • Andreas Haugstrup Pedersen

    I apologize for my confusion. If you just need the result of a calculation (which is what a reporting widget is) you can use https://developers.podio.com/doc/items/calculate-67633 to perform on the fly calculations.

    /Andreas

    0
    Comment actions Permalink
  • Juan

     

    Hi Andreas, 

     

    I have been looking for an example that could help me understand this with no luck. So, I've thought that maybe creating a simple case could help me and many other people trying to solve this same issue.

    Suppose I have a very simple podio application (App ID: "111"). This podio application is populated with 4 items (Client companies). Each item (which is a client/customer company) is just comprised by three fields: Name of company (text - external ID "name" - field ID "222" ), Industry (Category field that can have three possible values: "Industry A", "Industry B" and "Industry C" - external ID "industry" - field ID "333"), total account (money value which is let say in "USD" - external ID "account" - field ID "444").

    So Podio has the following in its data base:

    Item1: Name = Company A, Industry = Industry A, Total Account = $100

    Item2: Name = Company B, Industry = Industry C, Total Account = $150

    Item3: Name = Company C, Industry = Industry A, Total Account = $200

    Item4: Name = Company D, Industry = Industry C, Total Account = $10

    Lets say I want to obtain with one call GET or POST (in data format xls/xlsx if possible if no JSON,XML) the following aggregation (which inside podio with a widget is straight forward):

     

    Industry            Average Acount

    Industry A        $150

    Industry B        $0

    Industry C        $80

     

    Thanks I hope this helps other people too. In my case, (even though I would like to make this case specifics independent - it might help somebody in the future searching for a  Klipfolio example) i am trying to put podio and klipfolio (Dashboard app) talking together (with no intermediaries or back-ends in the middle) they give you a very simple form to fill out:

    URL https://api.podio.com/item/app/111/calculate

    Data Format (JSON,Excel,XML,CSV)

    Method (GET/POST)

    Body - 

    Query parameters - (Name and Value)

    Authentication (following Podio's and Klipfolio instructions is straight forward)

     

    So I am limited to one GET/POST call to create a DATA source for a Chart.

    0
    Comment actions Permalink
  • Andreas Haugstrup Pedersen

    I'm not sure what your question is. Are you unsure how to build your request body? You can see all the options on the link I gave you. In your case the request body would look something like:

    {

    "aggregation": "average",

    "formula": [

    {

    "type": "field",

    "value": 444

    }

    ],

    "groupings": [

    {

    "type": "field",

    "value": 333

    }

    ]

    }

    I'm genuinely curious to hear what you are finding confusing about the documentation page. We do want to make these as easy to understand as possible.

    All the best,

    Andreas 

    0
    Comment actions Permalink
  • Alexander Vikulin

    I have 2 apps: Clients and Payments. Clients app has a Balance field, which I want to update every time new payments are registered (via create/update/delete hooks). Payments has a reference field that has a reference to the Client.

    Thus I need to form a calculation request with "sum" aggregation on "amount" field and also limit it to payments by a certain client only.

    Could you, please, advise me how to correctly form such calculation request?

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk