402 with the code DASHBOARDS_NOT_AVAILABLE.
Reading the dashboards of a group requires access to the group. Creating, updating or deleting a dashboard or a chart requires the contributor or admin role on the group: a reader gets a 403.
Dashboards and charts
A dashboard belongs to one group and covers one entity type of it, given byentityType:
person: the people of the group;company: the companies of the group;- the name of an object type of the group, such as
Deals: the objects of that type. See Custom objects.
Chart settings
Type
type sets how the chart draws its numbers, and which fields it is split by:
A split the type doesn’t have is
null.
Measure
measure sets what each number of the chart is, with aggregation:
count: the number of records or, with afield, the number of records with a value in that field;sumandaverage: the sum or the average of a number field;ratio: the share of the records with achoiceof a select field, among the records with a value in that field. Onlymetriccharts have ratios.
Group-by and breakdown-by
groupBy and breakdownBy each name one field: { "field": "customFieldValues.grp_92ab3f1c-0386-434d-82d7-a91eb6badd71.Status" }. Dates are grouped by month only, and their rows are labelled YYYY-MM.
Filter
filter restricts the chart to the records that match it, null for no filter. It has the format of the filter of a view: see Filtering.
Chart status
A chart returns itsstatus:
working: the chart is computed, anddataholds its numbers;notConfigured: a field or a choice was never chosen, as on a chart left half set up in the app;broken: a field or a choice it uses was deleted, or a setting doesn’t fit its type;error: the chart couldn’t be computed, for instance because it uses a field the API doesn’t expose.
working chart has data. Any other status comes with problem, which says why, and data: null. A chart that isn’t working doesn’t prevent the other charts of the dashboard from being returned with their data.
Broken chart
Reading chart data
Ametric chart returns a single value. A chart with a group-by returns rows, one per value of the group-by field, or per pair of values with a breakdown-by, with the value and the recordCount of the row:
Pie chart
- “No value” is always returned. The row with
group: nullholds the records with nothing in the field, withrecordCount: 0when every record has a value.includeEmptyValuesonly tells whether the app shows it. - A ratio only counts the records with a value. It comes with
matching, the records with the choice, andoutOf, the records with a value in the field:valueismatching / outOf, andoutOfcan be lower thanrecordCount. - A record can be in several rows. When the group-by or the breakdown-by field can hold several values, such as a multiple select or a user field,
rowsOverlapistrueand the rows add up to more thanrecordCount. - Nothing to compute is
null, not0. An average over no value, or a ratio over no record with a value, returnsvalue: null.
overallValue is the measure computed over all the records of the chart, ignoring the splits. It is not always the sum of the rows: an average isn’t, and neither is a chart whose rows overlap.
Creating and updating
A dashboard is created with agroupId, a name, an entityType and, optionally, its charts, in display order. Unlike in the app, a dashboard created through the API gets no default chart: it holds only the charts sent.
A chart is added at the end of its dashboard. Its position and its display options get the defaults of the app, and can’t be changed through the API.
A chart must be working once created or updated: every field and choice it names must exist, and be of a kind its type and its measure can use. A chart that wouldn’t be working is rejected with a 422. When creating a dashboard, one such chart rejects the whole dashboard, and nothing is created.
An update of a chart changes only the settings it sends. measure and filter replace the current value as a whole: to add a condition, send back every current condition with the new one. A dashboard update only renames it.
When a field or a choice is deleted
Deleting a custom field of the group, or a choice of a select field, breaks the charts that use it in their measure, their group-by, their breakdown-by or their filter: their status becomesbroken, and the deleted field or choice reads null in the measure and the splits. Update the chart with another field or choice to make it work again.
Fields of a chart
The measure, the group-by, the breakdown-by and the filter of a chart use the field keys of the filter of a view. Not every field can be used in all of them. The tables below list where each field can be used.Dashboards of people
Dashboards of companies
Dashboards of objects
Custom fields
The custom fields of the dashboard are identified by their name:
customFieldValues.<groupId>.<Field name> on dashboards of people and companies, where <groupId> is the ID of the group, and customFieldValues.<Field name> on dashboards of objects. Native fields are never measured. A date is split by month, and its rows are labelled YYYY-MM.
Filtering
Read more about operators and value formats