iSheets API version 2 - iSheet admin - API - iSheet views - Get iSheet views
OVERVIEW
Get list of views for an iSheet
GET /api/3/isheets/admin/{isheetid}/views
<isheetviews>
List of iSheet view objects
</isheetviews>
Hi Imran Aziz, another bug with the iSheet view object. When retrieving views for an iSheet (JSON), sometimes the viewfilter settings come back in a "filterRows" container, and not the expected "rows" container. I haven't tried XML responses so I can't comment if it's the same for this content type. However looking at the rest of the response, the viewfilter 'row' is correct when the column collection is within columns: column[], and incorrect ('filterRows') when the column collection is within columns: columns[]. This is very similar to issues raised against the Get Column API end point. Here are the two different responses for reference:
"Incorrect" response:
{ "isheetview": [ { "viewid": 1351, "title": "Project Lookup", "markasdefault": 0, "emailview": 0, "columns": { "columns": [ { "columnid": 6840, "name": "Project No.", "type": 1, "section": 1718, "description": null, "addtodefaultview": null, "columnconditionstate": null, "columnconditions": null, "sequence": null, "columnSpecificDetail": null, "columnIdAttribute": null, "rawData": null }, ...etc ] }, "viewSortOrder": { "sortorder": [ { "columnID": "6840", "sortPosition": "1", "orderType": "1" } ] }, "viewFilter": { "filterRows": [ { "oprand": "Open", "displaytype": null, "rowID": 168, "columnID": 6843, "logicalType": "1", "operatorID": 1, "sheetFilterValueTypeID": "0" } ] } } ] }
"Correct" response, though we get a CDATA section in the JSON response:
{ "isheetview": [ { "viewid": 1351, "title": "Project Lookup", "markasdefault": 0, "emailview": 0, "columns": { "column": [ { "columnid": 6840, "name": "Project No.", "type": 1, "section": 1718, "description": null, "addtodefaultview": null, "columnconditionstate": null, "columnconditions": null, "columnspecificdetail": null, "sequence": null, "attributecolumnid": null }, ...etc ] }, "viewsortorder": { "sortorder": [ { "columnid": "6840", "ordertype": "1", "sortposition": "1" } ] }, "viewfilter": { "row": [ { "rowid": 168, "columnid": 6843, "operatorid": 1, "oprand": "<![CDATA[Open]]>", "logicaltype": "1", "sheetfiltervaluetypeid": "0" } ] } } ] }
Thanks, Andrew
Andrew Quinn thanks for raising the issue, I have registered this internally and will follow up on it.
Hi Imran Aziz, the column ordering in each iSheet view object does not reflect the column ordering defined for that view in Collaborate. The ordering is in database column id ascending order. This is the same for both JSON and XML responses. Attached is an example of the response received. The ordering in Collaborate for this example view is defined as:
- Address
- Title
- FullName
Whereas the response column collection is:
- Title
- FullName
- Address
Can this be raised as a bug please. Thanks, Andrew
Hi Imran Aziz,
Calling this endpoint with Accept = 'application/xml' works as accepted, however, calling with Accept = 'application/json' results in following error:
Multiple fields representing property "columnid": com.os.api.dbo.isheet.ColumnDBO#columnid vs com.os.api.dbo.isheet.ColumnDBO#columnIdAttribute (through reference chain: com.os.api.dbo.isheet.ISheetViews["isheetview"]->java.util.ArrayList[0]->com.os.api.dbo.isheet.ISheetView["columns"]->com.os.api.dbo.isheet.ColumnsDBO["column"]->java.util.ArrayList[0])
Can we log this as a bug please. Thank you, Andrew
Andrew Quinn thanks for raising the request I have noted this down and we will address it in the next round of API improvements for the iSheets module.
Hi Imran, can we have a version of this API call for non-admin callers? Use case would be a site Home dashboard in Collaborate that uses the API's to auto-discover the views available for this iSheet, for the current user. This could be useful for a dashboard that only displays panels/data if the user has access to the view.
Comments
6 Comments