Newer Version Available

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

Lens Resource

Returns the Analytics Cloud 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
34.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, 34.0 34.0
assetSharingUrl String The sharing URL for the lens. Small, 34.0 34.0
createdBy Wave User The creator of the lens. Small, 34.0 34.0
createdDate Date The time at which the lens was created, in ISO8601 date format. Small, 34.0 34.0
dataset Dataset Reference A reference to the dataset that this lens uses. Small, 34.0 34.0
files Lens File[] Information about the icon used to represent the lens in the user interface. Medium, 34.0 34.0
folderId ID The 18-character ID of the folder in which this lens is stored. Small, 34.0 34.0
id ID The 18-character lens ID. Small, 34.0 34.0
label String The label of the lens. Small, 34.0 34.0
lastAccessedDate Date The last time the lens was accessed, in ISO8601 date format. Small, 34.0 34.0
lastModifiedBy Wave User The user who last updated the lens. Small, 34.0 34.0
lastModifiedDate Date The last time the lens was modified, in ISO8601 date format. Small, 34.0 34.0
name String The name of the lens. Small, 34.0 34.0
permissions Permissions The permissions for the current user. Small, 34.0 34.0
refreshDate Date The date of the most recent current dataset that is used by the lens, in ISO8601 date format. Small, 34.0 34.0
state Lens State The state of the lens. Big, 34.0 34.0
type String The asset type. For lenses, the value is lens. Small, 34.0 34.0
url String The URL to the resource for the lens. Small, 34.0 34.0
visualizationType String The visualization type used for this lens. Values are:
  • calheatmap: Calendar heat map
  • comparisontable: Comparison table
  • heatmap: Heat map
  • hbar: Horizontal bar
  • hbarhdot: Horizontal dot plot
  • matrix: Matrix
  • parallelcoords: Parallel coordinates
  • pie: Donut
  • pivottable: Pivot table
  • scatter: Scatter plot
  • stackhbar: Stacked horizontal bar
  • stackvbar: Stacked vertical bar
  • time: Time line
  • valuestable: Values table
  • vbar: Vertical bar
  • vdot: Vertical dot plot
Small, 34.0 34.0
Lens File
Property Name Type Description Filter Group and Version Available Version
contentType String The content type of the file. Small, 34.0 34.0
fileLength Integer The length of the file in KB. Small, 34.0 34.0
fileName String The name of the file. Small, 34.0 34.0
id ID The 18-character lens file ID. Small, 34.0 34.0
lastModifiedDate Date The last modified date of the file, in ISO8601 date format. Small, 34.0 34.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, 34.0 34.0
options Lens Visualization Options The configuration options for different lens visualizations. Small, 34.0 34.0
query Query The SAQL query used to create this lens. Returned for all visualization types except for comparison tables. Small, 34.0 34.0
Column
Property Name Type Description Filter Group and Version Available Version
query Query The SAQL query used to create this column. Small, 34.0 34.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
Comparison Table maxColumnWidth, minColumnWidth, and totals
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
Raw Data Table hideHeaderColumn, maxColumnWidth, minColumnWidth, and totals
Scatter Plot fit, legend, legendHideHeader, legendWidth, and sqrt
Stacked Bar legend, legendHideHeader, legendWidth, maxColumnWidth, minColumnWidth, miniBars, normalize, and sqrt
Timeline legend, legendHideHeader, legendWidth, and sqrt
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, 34.0 34.0
hideHeaderColumn Boolean Indicates whether to display the header column. Small, 34.0 34.0
legend Boolean Indicates whether to display the legend. Small, 34.0 34.0
legendHideHeader Boolean Indicates whether to hide the legend header. Small, 34.0 34.0
legendWidth Integer The width of the legend Small, 34.0 34.0
maxColumnWidth Integer The maximum width of the header column. Small, 34.0 34.0
minColumnWidth Integer The minimum width of the header column. Small, 34.0 34.0
miniBars Integer The width of the mini-bars, if used. Small, 34.0 34.0
multiMetrics 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, 34.0 34.0
normalize Boolean Scale the position and size of the data shape so that it's proportional to its percentage of its category. Small, 34.0 34.0
splitAxis Boolean When true, each measure is projected onto one axis. When false, all measures use the same axis. Small, 34.0 34.0
sqrt Boolean Indicates that the horizontal vertical axes use a square root scale. Small, 34.0 34.0
trellis Boolean When true, the last group is treated as a trellis dimension. Every distinct value of the dimension is a chart. Small, 34.0 34.0
totals Boolean Indicates whether to display totals in the table. Small, 34.0 34.0
Query
Property Name Type Description Filter Group and Version Available Version
query String The SAQL query text. Small, 34.0 34.0
saqlVersion Double The SAQL version of this query. Small, 34.0 34.0
Example Response Body
1{
2  "allowPreview" : true,
3  "assetSharingUrl" : "https://na1.salesforce.com/
4      analytics/wave/lens?assetId=0FKD00000004CVjOAM&orgId=00DD00000007dBq&loginHost=
5      na1.salesforce.com&urlType=sharing",
6  "createdBy" : {
7    "id" : "005D00000018LSoIAM",
8    "name" : "User Name",
9    "profilePhotoUrl" : "https://na1.salesforce.com/profilephoto/005/T"
10  },
11  "createdDate" : "2015-02-06T17:40:28.000Z",
12  "dataset" : {
13    "id" : "0FbD000000000ExKAI",
14    "url" : "/services/data/v34.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://na1.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/v34.0/wave/lenses/0FKD00000004CVjOAM",
50  "visualizationType" : "valuestable"
51}