Podio View returns too many fields - podio

I'm using the API call Items: Filter items by view
POST /item/app/{app_id}/filter/{view_id}/
The issue I'm having is that Podio is returning many fields specifically excluded from the view.
The app has many calculation fields which contain a lot of data.
I've defined a view to only return the fields I'm interested in, and in the UI in table view, it shows correctly (only 2 fields are included in the view).
But when fetching the view data via API, I get all the calculation fields in the app items that I'm not interested in.
Is this a bug or "expected" behaviour?

This is expected behavior. You can only partially control list of fields returned by filter-items-by-view call.
Please review similar question answered here: Podio Php - limit the amount of item fields returned

Related

How to Collect dijit/form/combobox Selected Values in Repeat Control

An XPage is used to display the number of points a person has collected, and the number of points remaining (see below).
I have a repeat control which gets a collection of documents meeting a specific criteria. The last column in the control contains 5 digit/form/comboboxes, which are displayed or hidden, according to the number of fields on each document that contain data.
The layout contains gift cards worth a certain amount of points, and the person can select how many of each gift card they want. eg.
Company Available in Values of Points Required Quantity Requested
The Quantity Requested column contains the digit/form/comboboxes. As the person selects values in the checkbox, I want the number of points remaining to be recalculated.
The onChange event of the digit/form/comboboxes calls a function in an Output Script which calls an RPC, which in turn calls an SSJS function. The SSJS function cycles through the documents displayed in the repeat control, gathering the points required information. I then wanted it to also grab the Quantity Requested. I understand from a previous posting that because of the way the digit/form/combox is rendered, I can only get the value using CSJS with dijit.byId and perhaps putting the value in a hidden field and retrieving it from there.
I can't seem to wrap my head around how I will do this when the repeat control will make it possible for there to be many combobox1 and combobox2, etc.
The XPage is not bound to a form, because all the items are just calculated on the fly and then discarded.
What is the best way to do this?
The JSON RPC service can't interact with any changes made in the browser, see https://www.intec.co.uk/json-rpc-service-component-tree-manipulation-openlog/. This could be the cause of your problems.
You may be able to get around it by triggering a partial refresh (POST) before calling the JSON RPC. In theory that might work, because the component tree (server-side map of the XPage) would get updated by the partialRefreshPost and the updates picked up by the JSON RPC. It's possible though that the Restore View picks up a version of the XPage other than the one for the browser, I don't know. I've never investigated that.
It's been a while since I've worked with server java script, I have been doing it the managed bean way with ActionListeners. If you have the data in the UI, then can you avoid server side processing and do it client side?
You can also use the DOM XSP Object like XSP.setSubmittedValue to have a key value pair sent with your post request to the server side, you can only have one... it can be JSON or any other value you set it to from the client side javascript.
I figured out how to do this. If anyone wants the code, let me know and I'll provide it.

How can I get a list of items in a Rally instance via the REST API?

I want to get the list of items in the view lookup..but i just cant find what to query for that..i have tries everything but i just dont seem to get how to do it
I have even tried using
https://rally1.rallydev.com/slm/webservice/1.29/subscription.js?fetch=Workspaces,Projects,Name&pretty=true
but that only fetches me the worspace and projects
I am not sure what you mean by view lookup. In any case, it is not possible to query on all work items in a subscription. Here is an example of a query on all defects in a workspace, when Name,FormattedID,State are being fetched:
https://rally1.rallydev.com/slm/webservice/v2.0/defect?workspace=https://rally1.rallydev.com/slm/webservice/v2.0/workspace/1111&fetch=Name,FormattedID,State
All queries on work items are workspace scoped. You do not have to provide workspace explicitly as in the example above. If you are currently logged in to Rally in another tab of the same browser the context is already set, and this endpoint will work too:
https://rally1.rallydev.com/slm/webservice/v2.0/defect?&fetch=Name,FormattedID,State
You may want to narrow a scope by using a query parameter, e.g.
https://rally1.rallydev.com/slm/webservice/v2.0/defect?&query=(State = Open)&fetch=Name,FormattedID
Also, v2.0 removed the ability to return child collections in the same response for performance reasons. Now fetching a collection will return an object with the count and the url from which to get the collection data:
https://rally1.rallydev.com/slm/webservice/v2.0/Subscription/7777/Workspaces
where 7777 is OID of the subscription.
If you want to replicate a query in a custom view in Rally UI, open the view to determine the conditions and then build a similar query. Here is an example of a query that imitates a custom view below:
https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?query=((Blocked = true) AND (Owner.UserName = nick01#test.com))

Specify items per page

I'm trying to query Picasa Web Albums to pull album/photo data (obviously!) however initially I only need to pull the first 4 photos. Is there any way to limit a particular field or specify the items per page?
I've already accomplished something similar with Facebook's Graph API however I'm unable to find anything similar for Picasa. The only items I can find related to limiting the response is specifying which fields, but nothing related to the number of rows.
Use max-results argument. See doc here.
https://developers.google.com/picasa-web/docs/2.0/reference#Parameters

Possible to fetch full hierarchical requirements in single portfolio item web service call?

I'm trying to aggregate some information about the kanban states of my user stories. If query a PifTeam item, I get a summarized collection of UserStories associated with it.
Example query:
https://rally1.rallydev.com/slm/webservice/1.40/portfolioitem/pifteam/99999999999.js
However I then have to run a loop on the UserStories collection, individually querying each one to get at the information I need. This potentially results in a lot of web service calls.
Is there a way to return the full hierarchical requirement information in the original pifteam query so that there is only one webservice call which returns all sub-objects? I read the webservice api and was trying to play with the fetch parameter but had no success.
This functionality will be disabled in WSAPI 2.0 but will continue to be available in the 1.x versions. That said, you should be able to use a fetch the fields on story that you need like this:
/pifteam/9999.js?fetch=UserStories,FormattedID,Name,PlanEstimate,KanbanState
Fetch will hydrate the fields specified on sub objects even if the root object type doesn't have those fields. So by fetching UserStories the returned collection will populated with stories, each having the FormattedID, Name, PlanEstimate and KanbanState fields included.
There is no way to do it from Rally's standard Web Services API (WSAPI) but you can from the new Lookback API (LBAPI). The query would look something like this:
https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/<ObjectID_for_Workspace>/artifact/snapshot/query.js?find={__At:"current",_TypeHierarchy:"HierarchicalRequirement",Children:null,_ItemHierarchy:<ObjectID_for_PortfolioItem>}&fields=["Name"]
Fill in the ObjectIDs for your Workspace and PortfolioItem. The _ItemHierarchy field will cross work item type boundaries and goes all the way from PortfolioItems down through the Story hierarchy down to Defects and even Tasks, so I added _TypeHierarchy:"HierarchicalRequirement" to limit it to Stories. I have specified Children:null which means you'll only get back leaf Stories. The __At:"current" clause get's the current tree and values. Remember, it's the "Lookback" API, so you can retrieve the state of the object at any moment in history. __At:"current" says to get the current values and tree.
Note, the LBAPI is delayed from current values in the system by anywhere from seconds to minutes. Typically it's about 30 seconds behind. You can see how far behind it is by checking the ETLDate field in the response.
Details about the LBAPI can be found here. Note, that the LBAPI is available in preview now for almost all Rally customers. There are still a number of customers where it is not yet turned on. The best way to tell if it's working for your subscription is to try the query.

Venue History Pagination

How are we supposed to paginate through the venuehistory (https://developer.foursquare.com/docs/users/venuehistory) endpoint? In the docs, it mentions two parameters, beforeTimestamp and afterTimestamp, but the result set contains no reference timestamp points to paginate from. Am I missing something?
Background
I'm testing currently testing on an account with 22 items, so perhaps the pagination hasn't kicked in yet, but it would still be nice to cover this scenario. Thanks!
/users/venuehistory returns the user's whole venuehistory, so typically you do not need to paginate it. The beforeTimestamp and afterTimestamp are used if you want to only show history from a certain time period (such as only showing check-ins in January, for a calendar view of check-ins).