•••
 
Documentation   /   Reference: Data Studio   /   Widget reference
 
 

Widget reference

 

Widgets display list variables in a document or web page, usually data pulled in with [[INCLUDE=data]].

[[INCLUDE=widget(type:{type},{option}:{value},{option}:{value})]]
  • Separate options with commas.
  • Where an option takes several values, separate them with |: columns:name|value|stage.
  • To use a literal comma in a value, write ,::ok. For a literal pipe, write |::ok.
  • Column names are variable names, including any prefix from [[INCLUDE=data(prefix:...)]].

Options for all widgets

Option Description
type table, summary_table or score. Required.
title A title shown above the widget
filter Text to filter rows by when the widget loads

table

Shows rows of data with search and paging.

Option Description
columns The variables to show, in order. Required. The first column decides how many rows there are.
column_headings Headings, in the same order as columns
sum_on Columns to total at the bottom
avg_on Columns to average at the bottom
count_on Columns to count at the bottom
rpp Rows per page. Default and maximum 100.
hide_search Hides the search box
hide_paging Hides the page controls
hide_controls Hides all controls
[[INCLUDE=widget(type:table,columns:c_name|c_value|c_end,column_headings:Supplier|Value|Ends,sum_on:c_value,rpp:20)]]

summary_table

Groups rows by the value of the first column, and summarises the second.

Option Description
columns The column to group by, then the column to summarise. Required.
column_headings Headings for the two columns
show What to show for each group: count (default), sum, avg, min or max
sort column_1 sorts by the group name; column_2 sorts by the summary value
link A URL for each group. {{$}} is replaced by the group's value.
decimals Decimal places for the summary
rpp, hide_search, hide_paging, hide_controls, hide_totals As for table
[[INCLUDE=widget(type:summary_table,columns:t_stage|t_stage,column_headings:Stage|Tasks,show:count,sort:column_2)]]

score

Shows a single figure, such as a total or an average, optionally compared with another figure.

Option Description
columns The column, or columns, to calculate from. Required.
column_headings Labels for the figures
show count (default), sum, avg, min or max
decimals Decimal places
link A URL to open when the score is clicked
compare_as number compares the figures as numbers
compare_mode How the comparison is coloured. By default, a higher main figure shows green with an up arrow and a lower one red. reversed swaps the colours, for figures where lower is better. simple shows no colours.
[[INCLUDE=widget(type:score,columns:deals_value,show:sum,decimals:0,title:Open pipeline)]]
Note

Widgets read the variables the page already has. If a widget is empty, check that [[INCLUDE=data]] is on the same page, that its prefix matches the widget's column names, and that the feed returns data.