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.
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.
Thanks a lot. I managed to get everything working!!