Forum Discussion
Utilise Power Automate to automatically add data from a new week to table from a json api connection
- Anonymous1 year ago
Hi mphillenga
Can you try below steps, it may help you.
1. Create Parameters in the power bi file input start date and end date, then publish the report to the workspace.2. Create power automate flow to trigger dataset refresh,
Create the Power Automate Flow, Add HTTP Flow activity for post method
URI : https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
HEADER : {
"Content-Type": "application/x-www-form-urlencoded"
}
BODY : client_id={ClientId}&client_secret={Client Secret}&scope=https://graph.microsoft.com/.default&grant_type=client_credentials
Replace {tenantId}, {ClientId}, and {ClientSecret} with your values from the Azure portal
3. Get the barrier token from above request and send it to below post request
Headers :
{
"Content-Type": "application/json",
"Authorization": "Bearer {access_token}"
}
BODY:
{
"notifyOption": "MailOnFailure",
"parameters": {
"StartDate": "{StartDate}",
"EndDate": "{EndDate}"
}
}
bearer {access_token} : from previous output
to send StartDate and EndDate pass parameters.
please refer below microsoft document
Datasets - Update Parameters - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Thank you.
Why do you want to go this route instead of just a scheduled refresh? If you are just getting new data on a weekly basis set up a weekly refresh, or just go ahead and set a daily one.
andrewsommer thanks a lot for your quick response!
I'm new to this part of PowerBI. How do I get a weekly refresh of the data by scheduling a refresh? Is that through the web environment:
But do I have to change the API query, as it is now set to a specific date (&periodToDate=28-02-2025) ?
And to what do I have to set it?
Thanks,