The new PowerBIIntegration.Refresh() functionality within PowerApps is very useful.!
One issue I am finding is if I use the PowerApp visual within PowerBI to connect to an existing App I do not get the .Refresh() function available. It only appears when you create a new app from the visual.
Does anybody have a solution for this problem?
Hi @Anonymous ,
So far it is known that PowerBIIntegration.Refresh() doesn't work for existing PowerApps. An idea has been submitted here, you can vote on it if you need this feature:
Actually I did some investigating yesterday on how you convert a mobile app to a tablet app - by modifying the properties.json file within the app. I then started to look at the entities.json file and noticed the powerbiintegration entity was different between an app with the .Refresh() function and an app without. I think will a bit more tinkering I can modify the entities.json file to allow a premade app have the .Refresh() function.
I will keep you updated
Hi @Anonymous .
By any chance did you manage to find a workaround to the Refresh() limitation?
I've been trying for a while to get Refresh() to work with an existing app and have only just found this thread. It would have saved me around 6 hours if I'd found it earlier.
I think the only way to do this is to create a new app from PowerBI in the mobile format. Then modify the size of the mobile app.
Instruction on how to do that is here:
I think there would be a way to update the existing files but I need to spend some more time looking into the json files you can extract. I still need to convert a series of existing apps so if I find the solution I will post it here.
If your existing app is using the mobile phone resolution you could copy and paste all the elements from the old app into the new app and all should work. My issue is that my existing apps are in the tablet resolutions.
I have a solution - just tried and tested. All is working OK.
It is a bit involved but this is the principle.
Note: you will need to have your folder settings to display known file extentsion in the file names.
1 - Save your app to your local computer (the msapp file)
2 - add .zip to your file extention so you will have myappname.msapp.zip
3 - extract your zip file to show the contents of the app
4 - within the controls folder there is a file called 1.json we need to update this file to make an existing app compatible.
5 - open the file. Copy the contents use this website to format the json https://jsonformatter.curiousconcept.com/
copy the formatted json and paste it back into the original document.
The document should now look something like this:
I have highlighted the section which requires ammending.
Replace the section
I tried the workaround and it...
I think I may know the issue. It's here now, sitting between the keyboard and the chair.
What I should have said was, the data is in an O365 SharePoint List with the refresh schedules set at hourly intervals.
From what I now understand PowerBI will only refresh from O365 SharePoint lists at the set intervals, and the PowerBIIntegration.Refresh() will not intiate a commanded refresh. Could you confirm , please.
I'm sure this does works with other live data sources. Thanks for taking the time to help out.
I think your observations are correct, this function is not going to initiate a commanded refresh of your data sets. It is essentially the same as hitting the refresh button when viewing a report.
The reports I am using this for are all direct query so I see the results as expected from .Refresh()
I hope this helps.
Sorry if my response came a bit late... though I just want to confirm that I tested your solution and it worked fine in my case.
I thought it would be fair to give you a kudo. 😉
So to make a long story short, I took a standalone PowerApps application version which I had previously created and which
was connected to an Azure SQL Server database.
At this stage, as you may expect, trying to add the PowerBIIntegration.Refresh() method would have thrown an incompatibility error message.
Something was obviously missing. I thought this might be a good candidate to test and I decided to give your formula a try and see what I could come up with. I basically went through the very same steps you mentioned, i.e. downloading the .msapp file, extracting and modifying the 1.json section.
I then decided to delete the existing PowerApps application I had downloaded to avoid any conflict and uploaded the new modified msapp file version.
So far so good... I could then add PowerBIIntegration.Refesh() with no compatibility error.
The final step... I added the modified PowerApps version into a Power BI report - which was connected to the very same Azure SQL Server database
in DirectQuery mode - made some data updates though a PowerApps edit form - and voila... Power BI content updated instantly. Coooool.
I think we may have something here. Some may claim it may be a bit risky and the not best solution... but hey it worked pretty well on my side and I'm happy with that...
Thanks for sharing.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.