By default, the embedded dashboards use the data refresh rate set on the dashboard (or any of its reports) and the embedded dashboard updates in the background by re-running the queries as necessary to get fresh results for any of the reports.
On the Business plan, when creating a dashboard sharing link with the "Requires Secret" option, you have even better control of the timeliness of the data by using the data_timestamp
field in the sharingSecret
JWT structure that defines what constitutes "current" data. An example could be a time of last change in any data the dashboard shows, such as an updated_at
timestamp of records or the timestamp of last created item.
In Ruby, the code that creates a JWT with an explicit data_timestamp
could look like this:
require 'JWT'
hash = {
sharing_token: 'fc77dd26-1b9d-417d-9489-518bc4ab7431', # value from sharing link
exp: (Time.now + 10.years).to_i, # should be short
data_timestamp: last_update_timestamp
}
secret='d880b5e74cea82a4e8998ae0e8775176fb440a4569eb097505f7e08e555b17b5aad78b5fa1f47acd1fbfbd876631dfdd' # value from Organization settings
JWT.encode(hash, secret)
The data_timestamp value in the JWT token is a UNIX timestamp, same as the expiration, i.e. number of seconds since 1970 - e.g. 1577836800 for 2020-01-01 00:00:00.