Newer Version Available

This content describes an older version of this product. View Latest

Lens Resource

Returns a JSON file that describes the structure of a Wave Analytics lens with the specified ID (GET), deletes a lens (DELETE), or updates a lens (PATCH).
Resource URL
1/wave/lenses/<lens ID>
Formats
JSON
Available Version
36.0
HTTP Methods
GET, DELETE, and PATCH
PATCH Request Body
Request Body (for POST and /wave/lenses/<lens ID> PATCH)

When updating a lens, you can specify a single property by itself, or any combination of properties.

The state and visualizationType properties must be patched together if the type is being changed to (or from) comparison table.

Note

GET and PATCH Response Body
Property Name Type Description Filter Group and Version Available Version
allowPreview Boolean Indicates whether the user is allowed to preview the lens. Small, 36.0 36.0
assetSharingUrl String The URL for opening this asset in the Wave builder. This is a form of deep linking. The server examines the link parameters, which might include urlType, assetId, orgId, and loginHost, as well as other optional parameters, and translates as necessary to produce the correct result on the target client. For example, it will open the wave dashboard on desktop clients, or mobile if you are on a mobile OS. For example, the shared URL:
1http://{host}/​analytics/​application/​005xx000001SvSwAAK?​urlType=sharing&​orgId=00DT0000000Dpvc&​loginHost=​https%3A%2F%2F​test.my.salesforce.com
Might produce the following web Url:
1http://{host}/​insights/​web/​explore.apexp#​application/​005xx000001SvSwAAK
Or it might produce the following Url on iOS:
1com.salesforce.kona://​application/​005xx000001SvSwAAK&​orgId=00DT0000000Dpvc&​loginHost=​https%3A%2F%2F​test.my.salesforce.com
Small, 36.0 36.0
createdBy Wave User The creator of the lens. Small, 36.0 36.0
createdDate Date The time at which the lens was created, in ISO8601 date format. Small, 36.0 36.0
dataset Dataset Reference A reference to the dataset used to create this lens. Small, 36.0 36.0
files Lens File[] Information about the icon used to represent the lens in the user interface. Medium, 36.0 36.0
filesUrl String Url to lens files. Small, 36.0 36.0
folder Asset​Reference​Representation A reference to the folder in which this lens is stored. Small, 36.0 36.0
id ID The 18-character lens ID. Small, 36.0 36.0
label String The label of the lens. Small, 36.0 36.0
last​Accessed​Date Date The last time the lens was accessed, in ISO8601 date format. Small, 36.0 36.0
last​Modified​By Wave User The user who last updated the lens. Small, 36.0 36.0
last​Modified​Date Date The last time the lens was modified, in ISO8601 date format. Small, 36.0 36.0
name String The name of the lens. Small, 36.0 36.0
permissions Permissions The permissions for the current user. Small, 36.0 36.0
refresh​Date Date The date of the most recent current dataset that is used by the lens, in ISO8601 date format. Small, 36.0 36.0
state Lens State The state of the lens. Big, 36.0 36.0
type String The asset type. For lenses, the value is lens. Small, 36.0 36.0
url String The URL to the resource for the lens. Small, 36.0 36.0
visualization​Type String The visualization type used for this lens. Values are:
  • calheatmap: Calendar heat map
  • comparisontable: Compare table
  • heatmap: Heat map
  • hbar: Bar
  • hbarhdot: Horizontal dot plot
  • matrix: Matrix
  • parallelcoords: Parallel coordinates
  • pie: Donut
  • pivottable: Pivot table
  • scatter: Scatter plot
  • stackhbar: Stacked bar
  • stackvbar: Stacked column
  • time: Timeline
  • valuestable: Values table
  • vbar: Column
  • vdot: Vertical dot plot
Small, 36.0 36.0
Lens File
Property Name Type Description Filter Group and Version Available Version
contentType String The content type of the file. Small, 36.0 36.0
fileLength Integer The length of the file in KB. Small, 36.0 36.0
fileName String The name of the file. Small, 36.0 36.0
id ID The 18-character lens file ID. Small, 36.0 36.0
last​Modified​Date Date The last modified date of the file, in ISO8601 date format. Small, 36.0 36.0
Lens State
Property Name Type Description Filter Group and Version Available Version
columns Column[] A list of the columns for a comparison table lens. Only returned if the visualization type is a comparison table. Small, 36.0 36.0
options Lens Visualization Options The configuration options for different lens visualizations. Small, 36.0 36.0
query Query The SAQL query used to create this lens. Returned for all visualization types except for comparison tables. Small, 36.0 36.0
Column
Property Name Type Description Filter Group and Version Available Version
header String The header text for this column. Small, 36.0 36.0
hidden Boolean Indicates whether this column is hidden. Small, 36.0 36.0
query Query The SAQL query used to create this column. Small, 36.0 36.0
showBars Boolean Indicates whether to show bars for this column. Small, 36.0 36.0
sort String The sort order for this column. Values are:
  • Ascending: Sort in ascending order
  • Descending: Sort in descending order
  • InnerAscending: Sort within groups in ascending order
  • InnerDescending: Sort within groups in descending order
  • None: No sort order
Small, 36.0 36.0
Lens Visualization Options

The valid configuration options for a visualization. The properties available depend on the type of visualization.

Visualization Type Valid Properties
Bar legend, legendHideHeader, legendWidth, maxColumnWidth, minColumnWidth, miniBars, multiMetrics, splitAxis, sqrt, and trellis
Compare Table maxColumnWidth and minColumnWidth
Donut legend, legendHideHeader, and legendWidth
Dot Plot fit, legend, legendHideHeader, legendWidth, and sqrt
Heat Map legend, legendHideHeader, and legendWidth
Matrix legend, legendHideHeader, and legendWidth
Parallel Coordinates fit, legend, legendHideHeader, legendWidth, and sqrt
Pivot Table maxColumnWidth, minColumnWidth, and totals
Scatter Plot fit, legend, legendHideHeader, legendWidth, and sqrt
Stacked Bar/Column legend, legendHideHeader, legendWidth, maxColumnWidth, minColumnWidth, miniBars, normalize, and sqrt
Timeline fit, legend, legendHideHeader, legendWidth, and sqrt
Values Table hideHeaderColumn, maxColumnWidth, and minColumnWidth
Visualization Properties

The properties available depend on the type of visualization.

Property Name Type Description Filter Group and Version Available Version
fit Boolean Indicates whether to scale the position and size of a data shape so that it's proportional to its percentage of its category. Small, 36.0 36.0
hide​Header​Column Boolean Indicates whether to display the header column. Small, 36.0 36.0
legend Boolean Indicates whether to display the legend. Small, 36.0 36.0
legend​Hide​Header Boolean Indicates whether to hide the legend header. Small, 36.0 36.0
legend​Width Integer The width of the legend Small, 36.0 36.0
max​Column​Width Integer The maximum width of the header column. Small, 36.0 36.0
min​Column​Width Integer The minimum width of the header column. Small, 36.0 36.0
miniBars Integer The width of the mini-bars, if used. Small, 36.0 36.0
multi​Metrics Boolean When true, indicates that multiple measures are displayed on the same chart, side-by-side. When false, each measure is displayed on a separate chart. The default value is false. Small, 36.0 36.0
normalize Boolean Scale the position and size of the data shape so that it's proportional to its percentage of its category. Small, 36.0 36.0
splitAxis Boolean When true, each measure is projected onto one axis. When false, all measures use the same axis. Small, 36.0 36.0
sqrt Boolean Indicates that the horizontal vertical axes use a square root scale. Small, 36.0 36.0
trellis Boolean When true, the last group is treated as a trellis dimension. Every distinct value of the dimension is a chart. Small, 36.0 36.0
totals Boolean Indicates whether to display totals in the table. Small, 36.0 36.0
Query
Property Name Type Description Filter Group and Version Available Version
query String The SAQL query text. Small, 36.0 36.0
saqlVersion Double The SAQL version of this query. Small, 36.0 36.0
Example Response Body
1{
2  "allowPreview" : true,
3  "assetSharingUrl" : "https://yourInstance.salesforce.com/
4      analytics/wave/lens?assetId=0FKD00000004CVjOAM&orgId=00DD00000007dBq&loginHost=
5      yourInstance.salesforce.com&urlType=sharing",
6  "createdBy" : {
7    "id" : "005D00000018LSoIAM",
8    "name" : "User Name",
9    "profilePhotoUrl" : "https://yourInstance.salesforce.com/profilephoto/005/T"
10  },
11  "createdDate" : "2015-02-06T17:40:28.000Z",
12  "dataset" : {
13    "id" : "0FbD000000000ExKAI",
14    "url" : "/services/data/v36.0/wave/datasets/0FbD000000000ExKAI"
15  },
16  "files" : [ {
17    "contentType" : "image/png",
18    "fileLength" : 3105,
19    "fileName" : "assetPreviewThumb",
20    "id" : "0FJD00000004CEiOAM",
21    "lastModifiedDate" : "2015-02-06T17:40:29.000Z"
22  } ],
23  "folderId" : "00lD0000000w3y6IAA",
24  "id" : "0FKD00000004CVjOAM",
25  "label" : "UsersWithRoles Lens",
26  "lastAccessedDate" : "2015-04-02T23:02:12.000Z",
27  "lastModifiedBy" : {
28    "id" : "005D00000018LSoIAM",
29    "name" : "User Name",
30    "profilePhotoUrl" : "https://yourInstance.salesforce.com/profilephoto/005/T"
31  },
32  "lastModifiedDate" : "2015-02-06T17:40:28.000Z",
33  "name" : "UsersWithRoles_Lens",
34  "permissions" : {
35    "modify" : true,
36    "view" : true
37  },
38  "refreshDate" : "2015-02-20T17:42:50.000Z",
39  "state" : {
40    "options" : {
41      "sqrt" : true
42    },
43    "query" : {
44      "query" : "{&quot;values&quot;:[&quot;Name&quot;,&quot;CommunityNickname&quot;,&quot;Alias&quot;]}",
45      "saqlVersion" : -1.0
46    }
47  },
48  "type" : "lens",
49  "url" : "/services/data/v36.0/wave/lenses/0FKD00000004CVjOAM",
50  "visualizationType" : "valuestable"
51}