web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / First app use fails to...
Power Apps
Unanswered

First app use fails to work correctly

(0) ShareShare
ReportReport
Posted on by 3

I have written a Power App that has been embedded on Power BI report page.

Since it is much easier to develop Power App with browser than in Power BI Desktop, I have built the app like this:

- In App OnStart, the App only creates couple of constants that never change (when you use Power App from BI report, it doesn't read App's OnStart)

- App starts up with a page that has only an invisible timer of 0.001 second.

- This timer runs code


If( IsBlankOrError(varProjectID), Set( varProjectID, First([@PowerBIIntegration].Data).ProjectID ));
If( IsBlankOrError(varProjectID), Set( varProjectID, "PApps test case" ));
If( IsBlank(First(Filter('PATool.ProjectEscalation', ProjectID = varProjectID )).ProjectID), Set(varNewData,true), true, Set(varNewData,false));
If( varNewData, Patch( 'PATool.ProjectEscalation', Defaults('PATool.ProjectEscalation'), varBlankRecord ));

If(
Not(IsEmpty(Errors('PATool.ProjectEscalation'))),
Notify(
"_" & First(Errors('PATool.ProjectEscalation')).Message,
NotificationType.Error
)
);

After that it goes to web form that has 
DataSource: 'PATool.ProjectEscalation'
Item: First(Filter('PATool.ProjectEscalation', ProjectID = varProjectID ))

When I develop and test the App it works correctly by changing the DEV data with hard-coded key.

I have simplified this a bit, such as didn't include varBlankRecord creation code.

When I test with Power BI Desktop version 2022/12 or 2013/02 (as 2013/01 has App connector bug) the App works correctly: it reads the key correctly from Power BI and changes the production data.

When other people test the report on service they get varying results probably based on what has been done before that use by someone else:
- Three out of four got testing data (I believe they used this after my development)

- One out of three got production data, but with an error message "Error when trying to retrieve data from network"
- The app works perfectly to everyone after the first use during that active session, but I have also got an error message occasionally when developing and testing, so it is not strictly only the first use that fails.
- They need to approve database connection

I have tested the timer with three seconds also, but with the same result.
Why does the first App use from Power BI fail to use production data properly?

Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard