How a dynamic data link updates
Adriel regenerates the data behind a dynamic data link every 4 hours. To see when it last ran, open the table widget’s 3 vertical dots menu, click Export to GSS, and check Last updated under Dynamic data link. To regenerate the data immediately instead of waiting for the next cycle, click Refresh now next to Last updated. Processing time depends on the size of the table. When it finishes, Last updated shows the new time. The link always uses the latest published version of the dashboard, including its saved date range. A date range changed only while viewing the dashboard is not applied to the link.Why the sheet can still show older data
Google Sheets caches the result ofIMPORTDATA and recalculates it about once an hour (Google Docs Editors Help). So even after Adriel regenerates the link, a sheet that uses =IMPORTDATA("link") can keep showing the previous data for up to an hour.
To pull the latest data into the sheet right away, change the URL inside the formula so Google Sheets treats it as a new request. For example, add &v=2 to the end of the link, and increase the number each time:
Automate the refresh with Apps Script
The script fetches the dynamic data link directly and writes the result into a tab as plain values. Compared withIMPORTDATA:
- It is not cached by Google Sheets, so each run returns the latest data Adriel has generated.
- If a fetch fails, the previous data stays in the tab instead of turning into an error.
- The values can be edited, sorted, and referenced like any other cells. They are replaced on the next run.
1
Copy the dynamic data link
In Adriel, open the table widget’s 3 vertical dots menu, click Export to GSS, and click Copy dynamic data link.
2
Open the Apps Script editor
In the Google Sheet, create or pick the tab that will hold the data and note its exact name. Then click Extensions > Apps Script.
3
Paste the script
Delete any code in the editor and paste the script below.
4
Enter the link and the tab name
Replace
PASTE_YOUR_DYNAMIC_DATA_LINK_HERE with the copied link and PASTE_YOUR_TAB_NAME_HERE with the tab name. Keep the quotation marks. The tab name must match exactly, including spaces and case.5
Save and run once
Click Save, select
refreshAdrielData in the function list, and click Run. On the first run, Google asks for permission to access the spreadsheet and external services. Review and allow it.6
Check the sheet
Return to the sheet and confirm the data appears in the target tab. Reload the sheet to add the Adriel > Refresh data menu for refreshing on demand.
Run the script on a schedule
To refresh the tab automatically, add a time-driven trigger in the Apps Script editor (Apps Script triggers guide).1
Open the triggers page
In the Apps Script editor, click Triggers (clock icon) on the left.
2
Add a trigger
Click Add Trigger. Set the function to
refreshAdrielData, the event source to Time-driven, and pick an interval.3
Save the trigger
Click Save.
A trigger runs under the Google account that created it. If a scheduled run fails, Google emails that account a failure summary.
Troubleshooting
The script says the tab was not found
The script says the tab was not found
SHEET_NAME doesn’t match any tab. Copy the tab name exactly, including spaces and case, and save the script again.The script says it could not load data
The script says it could not load data
The link returned an error, so the previous data was kept. Check that
CSV_URL contains the full dynamic data link copied from Adriel. If the dashboard is password protected, the data isn’t accessible from Google Sheets.The sheet shows older data than Adriel
The sheet shows older data than Adriel
Compare the time of the last script run with Last updated in the Export to GSS modal. If Adriel hasn’t regenerated the link yet, click Refresh now, wait for Last updated to change, and run the script again.
Related
Exporting widget data
Export a widget to PDF, CSV, XLSX, Google Sheets, or email.
Scheduled exports
Manage recurring exports across the workspace.
Google Sheets FAQs
Common questions about Google Sheets and Adriel, including Apps Script OAuth errors.
