Skip to content

The moment it happens

Refresh a dataset when your data load finishes

Your report updates right after new data lands, and you get an email saying whether it worked.

Runs
The moment it happens
Apps
Power BI
AI
Not needed
Access
write (workspace Member/Contributor)

Send this to your assistant

Create a ClickRuntime automation: give me a link that refreshes my Sales dataset in the Power BI Sales Reporting workspace, and email me when the refresh has finished or failed.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A scheduled Power BI refresh runs at a fixed time whether or not the data is ready. If the nightly warehouse load finishes at 2:40 and the refresh runs at 2:30, the dashboard shows yesterday's numbers all morning. Data engineers end up padding schedules by an hour, and the reports still break whenever a load runs late.

When the data load finishes, it sends a request to ClickRuntime. That triggers a refresh of the dataset through the Power BI REST API, then polls the refresh status until it completes or fails and emails you the result. The refresh begins when the data is actually ready, with no guessed delay.

It also works from a link or button you click yourself, which is handy for analysts who want a refresh on demand without opening the Power BI service.

What you get out of it

  • Reports refresh when data is ready

    Triggering from the end of the load removes the gap between load time and refresh time. Morning dashboards show the new numbers as soon as the pipeline completes, even on days when the load runs long.

  • Fewer wasted refreshes

    A fixed schedule refreshes whether anything changed or not. Event-driven refreshes use your capacity only after new data arrives, which matters when you are close to the daily refresh limit for a dataset.

  • You hear the outcome, good or bad

    The email reports whether the refresh completed or failed, so you do not have to open the refresh history. A failure message lands in the same minute you would have been waiting for the dashboard.

  • Analysts stop asking engineers

    A person who needs fresh numbers for a meeting can use the link instead of messaging someone with workspace admin rights. That shortens a request that used to take an hour to a few seconds.

  • Pipeline and report stay in sync

    Because the refresh is tied to the load completing, a delayed upstream job delays the refresh with it. The dashboard is never newer than its source, which avoids half-loaded numbers appearing in front of executives.

How it works

What happens, step by step

  1. When your ClickRuntime link is called, for example right after new data lands, the automation asks Power BI to refresh your dataset.

  2. It checks back every 20 seconds until the refresh finishes.

  3. You get an email saying whether it completed or failed, with the finish time or the error.

Before it runs live

  • Connect Power BI
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Refresh a dataset when your data load finishesjust nowSucceeded
Email · Sales refresh completedFinished at 2026-10-19T10:14:52Z

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Power BI steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
trigger_a_refresh_on_schedule_or_link.pyexample
import time
from clickruntime import on_event, credentials, http, notify

GROUP_ID = "0f1e2d3c-4b5a-6978-8796-a5b4c3d2e1f0"  # Sales Reporting
DATASET_ID = "cfafbeb1-8037-4d0c-896e-a46fb27ff229"  # Sales
URL = f"https://api.powerbi.com/v1.0/myorg/groups/{GROUP_ID}/datasets/{DATASET_ID}/refreshes"

@on_event
def handle(event):
    headers = {"Authorization": f"Bearer {credentials.connection('power-bi', 'work')}"}
    resp = http.post(URL, headers=headers, json={"notifyOption": "NoNotification"})
    if resp.status_code != 202:
        notify.email_me("Sales refresh could not start", resp.text[:1000])
        return {"started": False}
    for _ in range(40):  # check every 20 s for up to ~13 minutes
        time.sleep(20)
        last = http.get(URL, params={"$top": 1}, headers=headers).json()["value"][0]
        if last["status"] in ("Completed", "Failed"):
            notify.email_me(f"Sales refresh {last['status'].lower()}",
                            f"Finished at {last.get('endTime')}\n{last.get('serviceExceptionJson', '')}")
            return {"status": last["status"]}
    notify.email_me("Sales refresh still running", "It started but hadn't finished after 13 minutes.")
    return {"status": "Unknown"}

FAQ

Common questions

How does the refresh get started from my pipeline?
Your pipeline, script or scheduler makes an HTTP request to a URL that ClickRuntime provides. When that request arrives, the refresh begins. Any tool that can call a web address at the end of a job, including a cron script or a data orchestrator, can do it.
How long does it wait for the refresh to finish?
It polls the refresh status at intervals until Power BI reports completed or failed, then sends the email. Large datasets can take many minutes, which is fine. The result email includes the final status so you know without checking.
Is there a limit on how often a dataset can refresh?
Power BI limits scheduled refreshes per day depending on your license, and API-triggered refreshes count toward limits on shared capacity. A dataset in Premium capacity has higher limits. Those limits belong to Power BI, so check your license before triggering many refreshes.
What permissions does it need?
write (workspace Member/Contributor). Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Refresh a dataset when your data load finishes” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.