Re: Saving Power BI query against a dataset in Excel file stored in SharePoint
Here is the code that works for me
"actions": {
"Run_a_query_against_a_dataset": {
"type": "OpenApiConnection",
"inputs": {
"parameters": {
"groupid": "myworkspace",
"datasetid": "xxx70223-cd73-484e-afc1-27b30472a873",
"specification/query": "EVALUATE TOPN(5,financials)",
"specification/serializerSettings/includeNulls": true
},
"host": {
"apiId": "/providers/Microsoft.PowerApps/apis/shared_powerbi",
"connection": "shared_powerbi",
"operationId": "ExecuteDatasetQuery"
}
}
},
"For_each": {
"type": "Foreach",
"foreach": "@outputs('Run_a_query_against_a_dataset')?['body/firstTableRows']",
"actions": {
"Add_a_row_into_a_table": {
"type": "OpenApiConnection",
"inputs": {
"parameters": {
"source": "sites/xxx.sharepoint.com,xxx57514-8505-4842-abb4-6d66a545eca9,xxxd1e9f-8269-4a25-94d6-88918274655b",
"drive": "xxxHXVWQWFQkirtG1mpUXsqZ8enW9pgiVKlNaIkYJ0ZVv4GztWKEJPSJr9b-o2fG_l",
"file": "xxx722ILYLA73JE35X3FCI6XG6AKKU3T74",
"table": "xxx491055-0BA9-48F8-AAB0-AE86297CA8AA}",
"item/Column 1": "@{items('For_each')?['[Country]']}"
},
"host": {
"apiId": "/providers/Microsoft.PowerApps/apis/shared_excelonlinebusiness",
"connection": "shared_excelonlinebusiness",
"operationId": "AddRowV2"
}
},
"metadata": {
"xxx722ILYLA73JE35X3FCI6XG6AKKU3T74": "/Example.xlsx",
"tableId": "xxx491055-0BA9-48F8-AAB0-AE86297CA8AA}"
}
}
},
"runAfter": {
"Run_a_query_against_a_dataset": [
"SUCCEEDED"
]
}
},
}