I have a flow using the Power BI API (swagger) custom connector discussed here: https://medium.com/@Konstantinos_Ioannou/refresh-powerbi-dataset-with-microsoft-flow-73836c727c33
I am creating a process to Export a pbix file from a workspace (https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exportreportingroup) -- this is working -- and then import it into another workspace (https://docs.microsoft.com/en-us/rest/api/power-bi/imports/postimportingroup) -- not working.
The import action from the Power BI API swagger file calls for groupId, datasetDisplayName, importInfo, and nameConflict.
groupId = groupId of the workspace I want to import the pbix to
datasetDisplayName = dataset/report name I have exported
importInfo = NEED FORMAT
nameConflict = CreateOrOverwrite
I attempted just passing the content of the Export and that didn't work: body('Export_pbix')['$content']
I attempted creating a file on SharePoint for the exported file, getting the file content from SharePoint, and passing that as the importInfo and that didn't work.
This document states, it is expecting the file as content-type = multipart/form-data (https://powerbi.microsoft.com/en-us/blog/upload-a-local-pbix-file-using-the-import-api/) - also stated
- To import a file, request Headers should include Content-Type: multipart/form-data with the file encoded as form data in the request body
I attempted converting the body content to base64 and that didn't work: base64(body('Export_pbix')['$content'])
I think I need to format this section as JSON but I am not sure what the format should be. Does anyone know?